Shortly after we renewed our SSL certificate on Heroku, all Mailgun webhooks (post requests made by Mailgun to our endpoint so that we can track email deliveries) started failing with the error "Could not connect to remote server: HTTPS certificate validation failure".
How could we check whether this issue might be caused from misconfiguration of our SSL certificate rather than an issue on Mailgun's side?
Here are the details of steps we took to renew and install the certificate:
- We followed these instructions to generate a new private key and CSR.
- After uploading the CSR and downloading the CRT file on Namecheap, we ran
heroku certs:update
as described here.
These are the checks we made to verify successful installation of the new certificate:
- Navigated to our site with Chrome, Safari, and Firefox and checked the certificates. Everything looks right.
- Ran
heroku certs
. The certificate looks good and it is shown astrusted
. - Used the online checker here and here (as watery suggested in the comments). Everything is green.
- Verified with Namecheap that the intermediates were setup correctly. They basically confirmed that the output of
openssl s_client -showcerts -connect www.mysite.com:443
looks right.
A potential lead:
- After running
brew update openssl
andrvm install 2.3.1 --disable-binary
, the following was observed. RunningNet::HTTP.get URI('https://www.google.com')
works, while the same command with our URL fails withOpenSSL::SSL::SSLError: SSL_connect returned=1 errno=0 state=error: certificate verify failed
. - However, running
Net::HTTP.get
for our URL on a freshly installed linux Docker container does not fail, so there may be additional environment factors.
Any leads to the likely cause of this issue, or suggestions for steps we can take to find such lead, are much appreciated.