Error while issuing simultaneous requests with custom SSLContext

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Error while issuing simultaneous requests with custom SSLContext

Fabrizio Cucci
Hi,

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.

I've forked his sample project and updated the test code which now basically shows my issue: https://github.com/fabriziocucci/JerseyBugTest . Just execute "mvn clean install".

Thanks in advance,
Fabrizio
Loading...