I am generating a self signed certificate using openssl in Ubuntu. I want to use it for localhost rest server. But while verification, I am getting error : x509: certificate signed by unknown authority
, can anyone please tell me how I can resolve this error?
Thanks!
2
Answers
Place your root certificate and intermediate (if you have one) in /usr/share/local/ca-certificates with the .crt extension.
Run:
In this case, curl is your friend:
Also you can run openssl s_client
Additionally, you can interrogate your certificate by providing your certificate:
If you certificate does not match, you know. Possibly you are using the wrong certificate for your REST API or the certificate is not being installed, which you can verify by looking in /etc/ssl/certs directory on your system (if you are running Linux)
Place your .crt certificate to /usr/share/ca-certificates
Edit /etc/ca-certificates.conf and add your certificate name there.
(Look at
update-ca-certificates
man page for more information.)Then run
sudo update-ca-certificates
Works for me in Ubuntu 22