SSL certificate verification fails, how do I find out what causes it?

I recently received a PositiveSSL certificate in Namecheap and installed it on my server. Accessing the site from Firefox works fine, but accessing it from the Ruby net / https library does not work: it cannot verify the connection certificate, even if I specified the path to the certificate, and I checked that the file is readable, Curl also fails :

curl --cacert /path/to/cert https://mysite.com/ 

He just says something like this:

 curl: (60) SSL certificate problem, verify that the CA cert is OK. Details: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed More details here: http://curl.haxx.se/docs/sslcerts.html curl performs SSL certificate verification by default, using a "bundle" of Certificate Authority (CA) public keys (CA certs). If the default bundle file isn't adequate, you can specify an alternate file using the --cacert option. If this HTTPS server uses a certificate signed by a CA represented in the bundle, the certificate verification probably failed due to a problem with the certificate (it might be expired, or the name might not match the domain name in the URL). If you'd like to turn off curl verification of the certificate, use the -k (or --insecure) option. 

"certificate verification failed" is not a terribly useful error message. How to find out what exactly is wrong with my certificate and what to do with it? I am confused that it works in a browser, but not elsewhere.

+4
source share
1 answer

It appears that curl requires the CA certificate file to contain ALL certificates in the chain. I downloaded all of them and combined them into one file, and now both Curl and Ruby are happy.

+2
source

Source: https://habr.com/ru/post/1340865/


All Articles