mirror of
https://github.com/jnunemaker/httparty
synced 2023-03-27 23:23:07 -04:00
24106eef27
This provides access to the connection object, which in turn exposes properties like `.peer_cert` for performing additional validation against x509 certificates. Closes #633, Follow-up to #634
9 lines
291 B
Ruby
9 lines
291 B
Ruby
dir = File.expand_path(File.join(File.dirname(__FILE__), '..', 'lib'))
|
|
require File.join(dir, 'httparty')
|
|
|
|
peer_cert = nil
|
|
HTTParty.get("https://www.example.com") do |fragment|
|
|
peer_cert ||= fragment.connection.peer_cert
|
|
end
|
|
|
|
puts "The server's certificate expires #{peer_cert.not_after}"
|