cURL error 60 SSL certificate problem self signed certificate in certificate chain
This error occurs when cURL is unable to verify the authenticity of the SSL certificate presented by the server. The error message specifically indicates that the certificate chain is self-signed, which means that the certificate was not issued by a trusted Certificate Authority (CA) but rather by the server itself.
To resolve this issue, you can do one of the following:
-
Disable SSL verification: This is not recommended as it compromises the security of the connection. However, if you need to quickly test something and can't obtain a valid SSL certificate, you can add the following option to your cURL command:
-k or --insecure
This will instruct cURL to not verify the SSL certificate.
-
Obtain a valid SSL certificate: You can obtain a valid SSL certificate from a trusted CA and install it on your server. This will ensure that the certificate presented by the server is validated by the client.
-
Add the self-signed certificate to the trusted CA store: This is not recommended as it also compromises the security of the connection. However, if you trust the server and need to connect to it frequently, you can add the self-signed certificate to the trusted CA store on your system. This will ensure that cURL trusts the certificate and allows the connection.
To do this, you can run the following command:
sudo cp /path/to/certificate.crt /usr/local/share/ca-certificates/
sudo update-ca-certificates
Replace
/path/to/certificate.crt
with the path to your self-signed certificate.Note: This may not work on all systems, and you may need to consult your system's documentation for specific instructions
原文地址: http://www.cveoy.top/t/topic/cw9t 著作权归作者所有。请勿转载和采集!