I'm running Ubuntu 18.04 on Windows Subsystem for Linux 2. I am making a curl
request to a web service running on the Windows side using a self-signed certificate. I receive this error:
curl: (60) SSL certificate problem: unable to get local issuer certificate
I'd like to add the cert to the local store. I have a .pfx
file available. I know I can use -k
but I want to use other command line tools against this server.
How do I do this?
My own trials
openssl s_client -showcerts -servername server -connect server:443 > foo.pem
openssl x509 -in foo.pem -inform PEM -out foo.crt
sudo cp foo.crt /usr/local/share/ca-certificates/
sudo update-ca-certificates
This looks plausible but didn't work, curl
still has the same complaint.
I also tried to use a DER
version.
sudo rm /usr/local/share/ca-certificates/windows_cert.crt
openssl x509 -in windows_cert.pem -inform PEM -out windows_cert_der.crt -outform DER
sudo cp windows_cert_der.crt /usr/local/share/ca-certificates/
sudo update-ca-certificates
Give up
Don't worry, I started following some of the replies here.
https://askubuntu.com/questions/73287/how-do-i-install-a-root-certificate
But got nowhere, its obviously a very hard problem in the world of computing.
I've found that a few months back they added a switch to the command line tool I need to use that ignores certificate problems.