Two sites. Only one works.
I have two SSL-enabled sites running on Heroku, both of which provide APIs. I bought the SSL certificates from different sources.
When I use Ruby and Python to make some POST calls to Site #1's API, everything works fine.
However, when I use Ruby and Python to make some POST calls to Site #2's API, I get SSL: certificate verify failed
errors. (Even though everything looks fine when I access the site in Chrome)
Ruby error for site 2:
OpenSSL::SSL::SSLError: SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed
Python error for site 2:
requests.exceptions.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:590)
Is a "Domain Validated" certificate enough?
I'd like other users to be able to access Site #2's API, without having to hack to get around this error. But I'm not sure what the problem is -- is it that my certificate is inherently insecure (it's only domain validated, but I believe certificate #1 is also only domain validated, so I'm not sure why that one works fine), or is it possible I messed something up when setting up SSL for Site #2 (so I can fix the problem without buying another certificate)?
If I do need to buy another certificate, do I need to make sure it's an OV or EV certificate? Or would a DV certificate from a certain source work? (I don't have an official company set up yet, so would prefer a DV certificate for now, even though I know it's less trustworthy-seeming.)
(I've googled these errors, but all the solutions seem to suggest some kind of local Ruby/Python problem, whereas I think I have a certificate problem.)
More details
More details about the troublesome certificate:
- Issued by COMODO RSA Domain Validation Secure Server CA.
- The "common name" is actually different from the domain I'm trying to access. (because this is intended to be a multi-domain certificate)
- If I view the details of the certificate in Chrome, Chrome says
Valid Certificate: The connection to this site is using a valid, trusted server certificate.
- ssllabs.com (https://www.ssllabs.com/ssltest/analyze.html) gives the domain 3 A+ ratings.
openssl s_client -connect www.hybridml.com:443 -servername www.hybridml.com -showcerts
to see (1) whether openssl validates the chain (I don't know if it will use the same truststore as python and ruby; it will differ from Chrome) and (2) either way capture the certs received and look at each one withopenssl x509 -text
to see if they are the ones you expect from your server or if imposterization is occurring as @Steffen hypothesizes.