Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →
class method
OpenSSL::SSL::SSLServer.new
(::TCPServer | ::UNIXServer svr, untyped ctx) -> ::OpenSSL::SSL::SSLServer
new(svr, ctx)
ext/openssl/lib/openssl/ssl.rb
View on GitHub ↗
# File tmp/rubies/ruby-4.1.0-preview1/ext/openssl/lib/openssl/ssl.rb, line 678
def initialize(svr, ctx)
@svr = svr
@ctx = ctx
if !ctx.frozen? && !ctx.session_id_context
# see #6137 - session id may not exceed 32 bytes
prng = ::Random.new($0.hash)
session_id = prng.bytes(16).unpack1('H*')
@ctx.session_id_context = session_id
end
@start_immediately = true
end
Creates a new instance of SSLServer.
-
srv is an instance of
TCPServer. -
ctx is an instance of
OpenSSL::SSL::SSLContext.