Class: OpenSSL::SSL::SSLServer
- Inherits:
-
Object
- Object
- OpenSSL::SSL::SSLServer
show all
- Includes:
- SocketForwarder
- Defined in:
- lib/openssl/ssl-internal.rb
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.
137
138
139
140
141
142
143
144
145
|
# File 'lib/openssl/ssl-internal.rb', line 137
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
135
136
137
|
# File 'lib/openssl/ssl-internal.rb', line 135
def start_immediately
@start_immediately
end
|
Instance Method Details
#accept ⇒ Object
159
160
161
162
163
164
165
166
167
168
169
170
|
# File 'lib/openssl/ssl-internal.rb', line 159
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
|
#close ⇒ Object
172
173
174
|
# File 'lib/openssl/ssl-internal.rb', line 172
def close
@svr.close
end
|
#listen(backlog = 5) ⇒ Object
151
152
153
|
# File 'lib/openssl/ssl-internal.rb', line 151
def listen(backlog=5)
@svr.listen(backlog)
end
|
#shutdown(how = Socket::SHUT_RDWR) ⇒ Object
155
156
157
|
# File 'lib/openssl/ssl-internal.rb', line 155
def shutdown(how=Socket::SHUT_RDWR)
@svr.shutdown(how)
end
|
#to_io ⇒ Object
147
148
149
|
# File 'lib/openssl/ssl-internal.rb', line 147
def to_io
@svr
end
|