Reputation: 8596
I am trying to use a Maven 2 repository via SSL secured with a self-signed certificate. I followed the instructions at HTTPS and Self-Signed Certificates in Java but I doesn't to work.
I think its because the certificate is a wild-card certificate. So I wonder if I should be doing something different to import the wild-card certificate?
Upvotes: 4
Views: 26081
Reputation: 212
Rather the tampering with the certificates for all java applications, generate a separate certificate file that only maven uses, and then use MAVEN_OPTS to set the -D parameter.
-Djavax.net.ssl.trustStore=/private/${ACCOUNT}/java/keystore.pks -Djavax.net.ssl.trustStorePassword=${PASSWORD}
See: https://developer.cloudbees.com/bin/view/DEV/Maven+with+untrusted+SSL+Certificates
Upvotes: 2
Reputation: 8596
The issue was not the use of a wild-card certificate after all. I had to import the CA certificate I used to sign the server certificate into the jssecacerts keystore rather than cacerts:
keytool -keystore %JAVA_HOME%\jre\lib\security\jssecacerts -import -file cacert.pem
Upvotes: 10
Reputation: 68328
-Djavax.net.debug=ssl
as that page suggests and include the outputUpvotes: 1