Module: OpenSSLExtensions::SSL::SSLSocket

Defined in:
lib/openssl-extensions/ssl/ssl_socket.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



7
8
9
10
11
12
13
14
# File 'lib/openssl-extensions/ssl/ssl_socket.rb', line 7

def self.included(base)
  base.send(:alias_method,
            :peer_cert_chain_without_openssl_extension,
            :peer_cert_chain)
  base.send(:alias_method,
            :peer_cert_chain,
            :peer_cert_chain_with_openssl_extension)
end

Instance Method Details

#peer_cert_chain_with_openssl_extensionObject

Rather than returning the default, unsorted Array of OpenSSL::X509::Certificate instances, this will filter that Array through the OpenSSLExtensions::X509::CertificateChain.



21
22
23
24
# File 'lib/openssl-extensions/ssl/ssl_socket.rb', line 21

def peer_cert_chain_with_openssl_extension
  OpenSSLExtensions::X509::CertificateChain.
    new(peer_cert, peer_cert_chain_without_openssl_extension)
end