Module: Coolio::SSL

Defined in:
lib/cool.io/http/ssl.rb

Instance Method Summary collapse

Instance Method Details

#ssl?Boolean

Returns:

  • (Boolean)


6
7
8
# File 'lib/cool.io/http/ssl.rb', line 6

def ssl?
  true
end

#ssl_client_startObject



30
31
32
33
# File 'lib/cool.io/http/ssl.rb', line 30

def ssl_client_start
  @ssl_method = :connect_nonblock
  ssl_init
end

#ssl_completed?Boolean

Returns:

  • (Boolean)


26
27
28
# File 'lib/cool.io/http/ssl.rb', line 26

def ssl_completed?
  !!!@ssl_method
end

#ssl_contextObject



18
19
20
21
22
23
24
# File 'lib/cool.io/http/ssl.rb', line 18

def ssl_context
  @ssl_context ||= begin
    c = OpenSSL::SSL::SSLContext.new
    # c.verify_mode = OpenSSL::SSL::VERIFY_NONE
    c
  end
end

#ssl_server_startObject



35
36
37
38
# File 'lib/cool.io/http/ssl.rb', line 35

def ssl_server_start
  @ssl_method = :accept_nonblock
  ssl_init
end

#ssl_socketObject



10
11
12
13
14
15
16
# File 'lib/cool.io/http/ssl.rb', line 10

def ssl_socket
  @ssl_scoket ||= begin
    s = OpenSSL::SSL::SSLSocket.new(@_io, ssl_context)
    s.sync_close = true
    s
  end
end