Open-source Languages & Tools for z/OS

 View Only

 GIT - error setting certificate verify locations

Grace Nelson's profile image
Grace Nelson posted 09-27-2021 16:16
Hi Everyone, 
We are facing an issue with SSL certificate. I got cacert.pem downloaded from the curl site . I'm  getting the below error message  when I run the GIT clone command , 

fatal: unable to access 'https://github-xxx.xxx.xxx/': error setting certificate verify locations:    

  CAfile: /SYSTEM/tmp/rsusr/ported/etc/cacert.pem                                                                                  

  CApath: none                                                                                                                      


Has anyone faced this issue?.
Sergey Rezepin's profile image
ROCKETEER Sergey Rezepin

Hi Grace!

Could you say which version of git you are using and send the output of 'env | sort' command?
git --version
env | sort

Thanks,
Sergey

Grace Nelson's profile image
Grace Nelson
The version of GIT is 2.26.2-78. I have attached the output of the environment variables.
Attachment  View in library
git env.docx 12 KB
Sergey Rezepin's profile image
ROCKETEER Sergey Rezepin

Hi Grace,

Thank you for the information.


1) Set up GIT_SSL_CAINFO
export GIT_SSL_CAINFO=/SYSTEM/tmp/rsusr/ported/etc/cacert.pem

2) Check that cacert.pem is readable
cat /SYSTEM/tmp/rsusr/ported/etc/cacert.pem | head -n 5

You can also -
3) Check the certificate chain at your repository:
openssl s_client -showcerts -connect github-url.xxx:443

4) Try to add the certificates from OpenSSL s_client output to cacert.pem file.

Thanks,
Sergey