Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"peer not authenticated " error in Artifactory plugin - Jenkins

I am using Jenkins version 1.566 and Artifactory plugin version 2.2.2.

I am running artifactory 2.66 in its own jetty container. It was running as http but recently I changed it to https.

Now if I change the artifactory server url in Jenkins configuration from http to https and port 8443, I get the error:

"Error occurred while requesting version information: peer not authenticated"

If I go to https url and login using the same user name and password am successful. Why is this error happening and how to fix it?

Any help is appreciated.

like image 714
user1164061 Avatar asked Feb 13 '23 10:02

user1164061


1 Answers

The cause of this error is using a self signed certificate for the Artifactory server which is not recognized by the Jenkins JVM. This is a common issue when using self signed certificates.
To solve this issue you will need to import the self signed certificate into the truststore used by Jenkins (by the JRE used for running Jenkins), for example:

<JAVA_HOME>\bin\keytool -import -v -trustcacerts
-alias server-alias -file server.cer
-keystore /path/to/cacerts -keypass changeit
-storepass changeit 

In this example:
server.cer is the self signed certificate you generated for Artifactory.
cacerts is the truststore used for Jenkins. By default you should find one inside your JRE - <JRE_HOME>/lib/security/cacerts. Notice this is not the same as the keystore used by Artifactory.
Notice the default keystore password is changeit. For more information take a look at the Oracle documentation for the keytool

like image 55
Dror Bereznitsky Avatar answered Feb 15 '23 01:02

Dror Bereznitsky