I started having problems accessing a https://ws.plimus.com/ with async-http-client a few days ago. I get a "General SSLEngine problem" messages, and in the stack trace I can see it is caused by
java.security.cert.CertificateException: Certificates does not conform to algorithm constraints
This SO question describes basically the same thing. Commenting out the line in java.security makes the error go away, but I assume there is good reason for MD2 to be disabled.
Using Raman's answer for hints, I found that indeed, the async-http-client library uses the X509TrustManager interface, but there's not much I can do to change that.
Running this:
openssl s_client -showcerts -connect ws.plimus.com:443 | grep -i md2
finds nothing, so I don't even know which certificate is causing the issue.
Is there something I can do, other than the workaround?
I put demo code that reproduces the problem on github.
The server you mentioned does indeed use the same Verisign Class 3 cert with the md2WithRSAEncryption algorithm that I described in my other answer:
and then converting that certificate to text form:
Perusing the javadocs for async-http-client, it looks like you can call
setSSLContext
when building an instance ofAsyncHttpClientConfig
:https://github.com/AsyncHttpClient/async-http-client/blob/master/api/src/main/java/org/asynchttpclient/AsyncHttpClientConfig.java#L841
So, you can create your own
SSLContext
with theX509ExtendedTrustManager
and configure the async http client library to use it, instead of its internal default. That should solve your problem!Here is a Gist which contains the SSL test code I used to debug this issue. You can easily extract from this what you need to create your own
SSLContext
: https://gist.github.com/rocketraman/8312705.