Search code examples
sslhttpsnexuskeytoolpkix

Unable to proxy Maven repo over https/ssl with Nexus


I followed the instructions given on this page to import the server certificate.

When I use keytool -list, I can see that the certificate is actually in the keystore. If I try to import the .crt file, keytool warns me that the keystore already contains the certificate.

Then I updated wrapper.conf with the two ssl options. I can see them on the command line of the Nexus process after a restart.

But when I try to add a proxy repo for the remote server, I always get sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

What did I miss?


Solution

  • You have to import the custom CA certificate into the 'trustStore' and not into the 'keyStore'.

    The procedure for creating a 'trustStore' is the same as the one for the 'keyStore'. Once you have your *.jks file then link it using the following system properties:

    javax.net.ssl.trustStore=<file>
    javax.net.ssl.trustStorePassword=<password>