Class: OpenSSL::SSL::SSLSocket

Inherits:
Object
  • Object
show all
Includes:
Buffering, Nonblock, SocketForwarder
Defined in:
lib/extensions/openssl/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 Nonblock

#initialize

Methods included from SocketForwarder

#addr, #closed?, #do_not_reverse_lookup=, #fcntl, #getsockopt, #peeraddr, #setsockopt

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

Methods included from Enumerable

#all?, #any?, #collect, #detect, #each_with_index, #find_all, #group_by, #inject, #max, #member?, #min, #sort, #sort_by, #to_a, #to_set

Instance Method Details

#post_connection_check(hostname) ⇒ Object



122
123
124
125
126
127
# File 'lib/extensions/openssl/openssl/ssl-internal.rb', line 122

def post_connection_check(hostname)
  unless OpenSSL::SSL.verify_certificate_identity(peer_cert, hostname)
    raise SSLError, "hostname was not match with the server certificate"
  end
  return true
end

#sessionObject



129
130
131
132
133
# File 'lib/extensions/openssl/openssl/ssl-internal.rb', line 129

def session
  SSL::Session.new(self)
rescue SSL::Session::SessionError
  nil
end