Class: OpenSSL::SSL::SSLServer
Instance Attribute Summary collapse
Instance Method Summary
collapse
#addr, #closed?, #do_not_reverse_lookup=, #fcntl, #getsockopt, #peeraddr, #setsockopt
Constructor Details
#initialize(svr, ctx) ⇒ SSLServer
Returns a new instance of SSLServer.
140
141
142
143
144
145
146
147
148
|
# File 'lib/extensions/openssl/openssl/ssl-internal.rb', line 140
def initialize(svr, ctx)
@svr = svr
@ctx = ctx
unless ctx.session_id_context
session_id = OpenSSL::Digest::MD5.hexdigest($0)
@ctx.session_id_context = session_id
end
@start_immediately = true
end
|
Instance Attribute Details
Returns the value of attribute start_immediately.
138
139
140
|
# File 'lib/extensions/openssl/openssl/ssl-internal.rb', line 138
def start_immediately
@start_immediately
end
|
Instance Method Details
162
163
164
165
166
167
168
169
170
171
172
173
|
# File 'lib/extensions/openssl/openssl/ssl-internal.rb', line 162
def accept
sock = @svr.accept
begin
ssl = OpenSSL::SSL::SSLSocket.new(sock, @ctx)
ssl.sync_close = true
ssl.accept if @start_immediately
ssl
rescue SSLError => ex
sock.close
raise ex
end
end
|
175
176
177
|
# File 'lib/extensions/openssl/openssl/ssl-internal.rb', line 175
def close
@svr.close
end
|
#listen(backlog = 5) ⇒ Object
154
155
156
|
# File 'lib/extensions/openssl/openssl/ssl-internal.rb', line 154
def listen(backlog=5)
@svr.listen(backlog)
end
|
#shutdown(how = Socket::SHUT_RDWR) ⇒ Object
158
159
160
|
# File 'lib/extensions/openssl/openssl/ssl-internal.rb', line 158
def shutdown(how=Socket::SHUT_RDWR)
@svr.shutdown(how)
end
|
150
151
152
|
# File 'lib/extensions/openssl/openssl/ssl-internal.rb', line 150
def to_io
@svr
end
|