Sha256: c4cd525cbcb1b531cb34e640a9f8c437b0f8802ed032a48f385869f503e17318

Contents?: true

Size: 291 Bytes

Versions: 134

Compression:

Stored size: 291 Bytes

Contents

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}"

Version data entries

134 entries across 109 versions & 6 rubygems

Version Path
harbr-0.1.79 vendor/bundle/ruby/3.2.0/gems/httparty-0.21.0/examples/peer_cert.rb
harbr-0.1.78 vendor/bundle/ruby/3.2.0/gems/httparty-0.21.0/examples/peer_cert.rb
harbr-0.1.77 vendor/bundle/ruby/3.2.0/gems/httparty-0.21.0/examples/peer_cert.rb
harbr-0.1.76 vendor/bundle/ruby/3.2.0/gems/httparty-0.21.0/examples/peer_cert.rb
harbr-0.1.75 vendor/bundle/ruby/3.2.0/gems/httparty-0.21.0/examples/peer_cert.rb
harbr-0.1.74 vendor/bundle/ruby/3.2.0/gems/httparty-0.21.0/examples/peer_cert.rb
harbr-0.1.73 vendor/bundle/ruby/3.2.0/gems/httparty-0.21.0/examples/peer_cert.rb
harbr-0.1.72 vendor/bundle/ruby/3.2.0/gems/httparty-0.21.0/examples/peer_cert.rb
harbr-0.1.71 vendor/bundle/ruby/3.2.0/gems/httparty-0.21.0/examples/peer_cert.rb
harbr-0.1.70 vendor/bundle/ruby/3.2.0/gems/httparty-0.21.0/examples/peer_cert.rb
harbr-0.1.69 vendor/bundle/ruby/3.2.0/gems/httparty-0.21.0/examples/peer_cert.rb
harbr-0.1.68 vendor/bundle/ruby/3.2.0/gems/httparty-0.21.0/examples/peer_cert.rb
harbr-0.1.67 vendor/bundle/ruby/3.2.0/gems/httparty-0.21.0/examples/peer_cert.rb
harbr-0.1.66 vendor/bundle/ruby/3.2.0/gems/httparty-0.21.0/examples/peer_cert.rb
harbr-0.1.65 vendor/bundle/ruby/3.2.0/gems/httparty-0.21.0/examples/peer_cert.rb
harbr-0.1.64 vendor/bundle/ruby/3.2.0/gems/httparty-0.21.0/examples/peer_cert.rb
harbr-0.1.63 vendor/bundle/ruby/3.2.0/gems/httparty-0.21.0/examples/peer_cert.rb
harbr-0.1.62 vendor/bundle/ruby/3.2.0/gems/httparty-0.21.0/examples/peer_cert.rb
harbr-0.1.61 vendor/bundle/ruby/3.2.0/gems/httparty-0.21.0/examples/peer_cert.rb
harbr-0.1.60 vendor/bundle/ruby/3.2.0/gems/httparty-0.21.0/examples/peer_cert.rb