I have an issue to install Jenkins from https://share.jenkins.io as described on https://phoenixnap.com/kb/install-jenkins-ubuntu.
I tried to follow the instructions I found, but apt does not accept the certificates.
This is doubtlessly because of our companies proxy which is playing man-in-the-middle and exchanges SSL keys.
I could not add the GPG key into the keyring directory with
curl -fsSL https://pkg.jenkins.io/debian-stable/jenkins.io.key | sudo tee /usr/share/keyrings/jenkins-keyring.asc > /dev/null
because the curl request was not successful:
curl: (60) SSL certificate problem: self-signed certificate in certificate chain
More details here: https://curl.se/docs/sslcerts.html
curl failed to verify the legitimacy of the server and therefore could not
establish a secure connection to it. To learn more about this situation and
how to fix it, please visit the web page mentioned above.
Here I could simply add switch -k to ignore certificate issues:
curl -kfsSL https://pkg.jenkins.io/debian-stable/jenkins.io.key | sudo tee /usr/share/keyrings/jenkins-keyring.asc > /dev/null
After that I added the repo to the source list with
echo deb [signed-by=/usr/share/keyrings/jenkins-keyring.asc] https://pkg.jenkins.io/debian-stable binary/ | sudo tee /etc/apt/sources.list.d/jenkins.list > /dev/null
which worked.
However, when I execute sudo apt update it is not successfull:
It ignores the Jenkins repository because of a certificate issue:
Ign:1 https://pkg.jenkins.io/debian-stable binary/ InRelease
Ign:1 https://pkg.jenkins.io/debian-stable binary/ InRelease
Err:1 https://pkg.jenkins.io/debian-stable binary/ InRelease
Certificate verification failed: The certificate is NOT trusted. The certificate issuer is unknown. Could not handshake: Error in the certificate verification. [IP: 151.101.2.133 443]
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
128 packages can be upgraded. Run 'apt list --upgradable' to see them.
W: Failed to fetch https://pkg.jenkins.io/debian-stable/binary/InRelease Certificate verification failed: The certificate is NOT trusted. The certificate issuer is unknown. Could not handshake: Error in the certificate verification. [IP: 151.101.2.133 443]
W: Some index files failed to download. They have been ignored, or old ones used instead.
-EDIT- A simple update of the CA certificates as found via
sudo apt install ca-certificates
does not solve the issue, and I neither want to disable certificates nor the GPG check, e.g. via sudo apt-get --allow-unauthenticated upgrade,
sudo apt -o Acquire::AllowInsecureRepositories=true \
-o Acquire::AllowDowngradeToInsecureRepositories=true \
update
or apt-get -o APT::Get::AllowUnauthenticated=true.