wget and curl behind corporate proxy throws certificate is not trusted or certificate doesn't have a known issuer
If you try to run wget or curl in Ununtu/Debian behind corporate proxy, you might receive errors like:
ERROR: The certificate of 'apertium.projectjj.com' is not trusted. ERROR: The certificate of 'apertium.projectjj.com' doesn't have a known issuer.
wget https://apertium.projectjj.com/apt/apertium-packaging.public.gpg ERROR: cannot verify apertium.projectjj.com's certificate, issued by 'emailAddress=proxyteam@corporate.proxy.com,CN=diassl.corporate.proxy.com,OU=Division UK,O=Group name,L=Company,ST=GB,C=UK': Unable to locally verify the issuer's authority. To connect to apertium.projectjj.com insecurely, use `--no-check-certificate'.To solution is to install your company's CA certificate in Ubuntu.
- In Windows, open the first part of URL in your web browser. e.g. open https://apertium.projectjj.com in web browser.
- If you inspect the certifcate, you will see the same CN (diassl.corporate.proxy.com), as reported by the error above
- Run certmgr.msc in Windows Run dialog.
- Open Trusted Root Certification Authorities > Certificates
- Find the certificate with name / issued by values ame as CN above.
- Right click it > All Tasks > Export as Base64 encoded X.509 (cer). Note: .crt and .cer are same thing as long as you export as base64. Its a Windows thing its nothing to do with the file.
- Rename the file's extension to .crt (Any other extension won't be accepted by Ubuntu).
- Copy the certificate.crt to Ubuntu box and install it:
mkdir /usr/local/share/ca-certificates/company cp certificate.crt /usr/local/share/ca-certificates/company/ chmod -R 755 /usr/local/share/ca-certificates/company sudo update-ca-certificates
Comments