class Plum::SSLSocketServerConnection

Constants

CIPHER_BLACKLIST

Attributes

sock[R]

Public Class Methods

new(sock, local_settings = {}) click to toggle source
Calls superclass method Plum::ServerConnection::new
# File lib/plum/server/ssl_socket_connection.rb, line 5
def initialize(sock, local_settings = {})
  @sock = sock
  super(@sock.method(:write), local_settings)

  if @sock.respond_to?(:cipher) # OpenSSL::SSL::SSLSocket-like
    if CIPHER_BLACKLIST.include?(@sock.cipher.first) # [cipher-suite, ssl-version, keylen, alglen]
      on(:negotiated) {
        raise RemoteConnectionError.new(:inadequate_security)
      }
    end
  end
end

Public Instance Methods

close() click to toggle source

Closes the socket.

Calls superclass method Plum::Connection#close
# File lib/plum/server/ssl_socket_connection.rb, line 19
def close
  super
  @sock.close
end