Answer the question
In order to leave comments, you need to log in
How to install a certificate in the Jersey client for authentication on the server?
Good afternoon.
Generated x.509 server and client certificates, keystore, truststore based on the article
" https://dzone.com/articles/securing-rest-apis-with... "
On the server (Spring-boot 2.1) enabled https. Imported the client keystore (.p12) into the browser, the server responds, everything is ok.
On the java client I use jersey client 2.26
, the setup is as follows:
HostnameVerifier allHostsValid = (hostname, session) -> true;
SslConfigurator sslConfig = SslConfigurator.newInstance()
.keyStoreFile("/path/to/client/keystore/client.p12")
.keyStoreType("PKCS12")
.keyPassword("password");
SSLContext sslContext = sslConfig.createSSLContext();
Client client = ClientBuilder.newBuilder()
.sslContext(sslContext)
.hostnameVerifier(allHostsValid)
.register(feature)
.build();
SunCertPathBuilderException: unable to find valid certification path to requested target
.sslContext(getSslContext()) the same error.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question