Java7にしたらHTTPS通信でエラーになる

Caused by: java.security.cert.CertificateException: Certificates does not conform to algorithm constraints
at sun.security.ssl.AbstractTrustManagerWrapper.checkAlgorithmConstraints(SSLContextImpl.java:946)
at sun.security.ssl.AbstractTrustManagerWrapper.checkAdditionalTrust(SSLContextImpl.java:872)
at sun.security.ssl.AbstractTrustManagerWrapper.checkServerTrusted(SSLContextImpl.java:814)
...

昔作ったJava6ベースのアプリでX509TrustManagerをカスタマイズして実装している場合、ちょっとうまくないみたい。


7113275 : compatibility issue with MD2 trust anchor and old X509TrustManager
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7113275


とりあえずの対処(セキュリティーには目をつぶって、とりあえず動けばいい的な)としては、
java.secureityファイルの以下をコメントにする

jdk.certpath.disabledAlgorithms=MD2

か、同様のことをコード中でも可能

Security.setProperty("jdk.certpath.disabledAlgorithms", "");

参考
Arrrggh! java.security.cert.CertificateException: Certificates does not conform to algorithm constraints
http://www.richardnichols.net/2012/08/arrrggh-java-security-cert-certificateexception-certificates-does-not-conform-to-algorithm-constraints/
プログラムの中でアルゴリズム制限を指定する
http://blog.livedoor.jp/k_urushima/archives/1615933.html