Class: Async::IO::SecureEndpoint
Instance Attribute Summary
Attributes inherited from Endpoint
#options, #specification
Instance Method Summary
collapse
Methods inherited from Endpoint
#accept, each, #initialize, parse, #socket_domain, #socket_protocol, #socket_type, ssl, tcp, #to_sockaddr, udp, unix
Instance Method Details
#bind(&block) ⇒ Object
167
168
169
170
171
|
# File 'lib/async/io/endpoint.rb', line 167
def bind(&block)
specification.bind do |server|
yield SSLServer.new(server, context)
end
end
|
#connect(&block) ⇒ Object
173
174
175
176
177
178
179
180
181
|
# File 'lib/async/io/endpoint.rb', line 173
def connect(&block)
specification.connect do |socket|
ssl_socket = SSLSocket.connect_socket(socket, context)
ssl_socket.connect
yield ssl_socket
end
end
|
#context ⇒ Object
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
|
# File 'lib/async/io/endpoint.rb', line 150
def context
if context = options[:ssl_context]
if params = self.params
context = context.dup
context.set_params(params)
end
else
context = ::OpenSSL::SSL::SSLContext.new
if params = self.params
context.set_params(params)
end
end
return context
end
|
#params ⇒ Object
146
147
148
|
# File 'lib/async/io/endpoint.rb', line 146
def params
options[:ssl_params]
end
|