Skip to content
instance method

OpenSSL::SSL::SSLContext#min_version=

(::OpenSSL::SSL::tls_version version) -> ::OpenSSL::SSL::tls_version
ctx.min_version = OpenSSL::SSL::TLS1_2_VERSION
ctx.min_version = :TLS1_2
ctx.min_version = nil

Sets the lower bound on the supported SSL/TLS protocol version. The version may be specified by an integer constant named OpenSSL::SSL::*_VERSION, a Symbol, or nil which means “any version”.

Example

Example
ctx = OpenSSL::SSL::SSLContext.new
ctx.min_version = OpenSSL::SSL::TLS1_1_VERSION
ctx.max_version = OpenSSL::SSL::TLS1_2_VERSION

sock = OpenSSL::SSL::SSLSocket.new(tcp_sock, ctx)
sock.connect # Initiates a connection using either TLS 1.1 or TLS 1.2
See also #max_version= #options #groups= #options= also in 4.1 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0