Error while issuing simultaneous requests with custom SSLContext
I was playing a bit with the Jersey client when I came across an unexpected error:
sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
Basically, I was starting multiple threads, creating a Jersey client in each of them using a custom SSLContext and sending a request to the server.
I've found this issue: https://java.net/jira/browse/JERSEY-3124 which looks very similar to the problem I'm currently facing. The main difference is that the guy who reported that was sharing the same Jersey client across all threads while I'm creating a new one for each of them. I didn't quite get why the issue was marked as "Works as designed" but I would really like to understand how to solve the problem.