class OpenSSL::SSL::SSLSocket
def client_cert_cb
def client_cert_cb @context.client_cert_cb end
def post_connection_check(hostname)
This method MUST be called after calling #connect to ensure that the
Perform hostname verification following RFC 6125.
ssl.post_connection_check(hostname) -> true
call-seq:
def post_connection_check(hostname) if peer_cert.nil? msg = "Peer verification enabled, but no certificate received." if using_anon_cipher? msg += " Anonymous cipher suite #{cipher[0]} was negotiated. " \ "Anonymous suites must be disabled to use peer verification." end raise SSLError, msg end unless OpenSSL::SSL.verify_certificate_identity(peer_cert, hostname) raise SSLError, "hostname \"#{hostname}\" does not match the server certificate" end return true end
def session
Returns the SSLSession object currently used, or nil if the session is
ssl.session -> aSession
call-seq:
def session SSL::Session.new(self) rescue SSL::Session::SessionError nil end
def session_get_cb
def session_get_cb @context.session_get_cb end
def session_new_cb
def session_new_cb @context.session_new_cb end
def sysclose
connection gracefully.
Sends "close notify" to the peer and tries to shut down the SSL
ssl.sysclose => nil
call-seq:
def sysclose return if closed? stop io.close if sync_close end
def tmp_dh_callback
def tmp_dh_callback @context.tmp_dh_callback || OpenSSL::PKey::DEFAULT_TMP_DH_CALLBACK end
def tmp_ecdh_callback
def tmp_ecdh_callback @context.tmp_ecdh_callback end
def using_anon_cipher?
def using_anon_cipher? ctx = OpenSSL::SSL::SSLContext.new ctx.ciphers = "aNULL" ctx.ciphers.include?(cipher) end