Class: OpenSSL::SSL::SSLSocket

Inherits:
Object
  • Object
show all
Includes:
Nonblock, Buffering, SocketForwarder
Defined in:
lib/jopenssl22/openssl/ssl.rb,
lib/jopenssl18/openssl/ssl-internal.rb,
lib/jopenssl19/openssl/ssl-internal.rb

Constant Summary

Constants included from Buffering

Buffering::BLOCK_SIZE

Instance Attribute Summary

Attributes included from Buffering

#sync

Instance Method Summary collapse

Methods included from Buffering

#<<, #close, #each, #each_byte, #eof?, #flush, #getc, #gets, #initialize, #print, #printf, #puts, #read, #read_nonblock, #readchar, #readline, #readlines, #readpartial, #ungetc, #write, #write_nonblock

Instance Method Details

#post_connection_check(hostname) ⇒ Object

Perform hostname verification after an SSL connection is established

This method MUST be called after calling #connect to ensure that the hostname of a remote peer has been verified.


124
125
126
127
128
129
# File 'lib/jopenssl22/openssl/ssl.rb', line 124

def post_connection_check(hostname)
  unless OpenSSL::SSL.verify_certificate_identity(peer_cert, hostname)
    raise SSLError, "hostname \"#{hostname}\" does not match the server certificate"
  end
  return true
end