'Download all intermediate CA certificates for a given SSL server certificate

Within Ruby, don't know if it is possible to download all intermediate CA certificates for a given SSL server certificate. Preferably with openssl gem.

Essentially what https://whatsmychaincert.com does: read a certificate, and dump the various certificates in the chain associated.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source