I have cases that a few customers get an error while posting to our server (HTTPS). This is the error:
SSL_connect returned=1 errno=0 state=error: certificate verify failed (unable to get local issuer certificate)
I can use this method to detect what fails in the certificate chain:
openssl s_client -connect <url>:443 -CAfile <path/cacert.pem>
But, not all customers are willing to download and install openssl. So, I want to add this test using ruby code (we already have ruby installed on the customer's computer).