Class: Wreq::TlsInfo

Inherits:
Object
  • Object
show all
Defined in:
lib/wreq_ruby/tls.rb

Instance Method Summary collapse

Instance Method Details

#inspectString

Return a compact summary for debugging.

The summary reports the leaf certificate size and the number of certificates in the chain without printing the DER data.

Examples:

tls_info.inspect
# => "#<Wreq::TlsInfo peer_certificate=781B peer_certificate_chain=1>"

Returns:

  • (String)

    TLS certificate metadata



64
65
66
67
68
69
70
71
# File 'lib/wreq_ruby/tls.rb', line 64

def inspect
  certificate = peer_certificate
  chain = peer_certificate_chain
  certificate_size = certificate ? "#{certificate.bytesize}B" : "nil"
  chain_size = chain ? chain.length : "nil"

  "#<#{self.class} peer_certificate=#{certificate_size} peer_certificate_chain=#{chain_size}>"
end