How to get https server certificate using Net::HTTP or HTTPClient Ruby lib?
I found a solution using HTTPClient lib
require 'rubygems'
require 'httpclient'
client = HTTPClient.new
response = client.get("https://gmail.google.com")
cert = response.peer_cert
Make sure you have httpclient gem installed
sudo gem install httpclient
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With