本文簡要介紹ruby語言中 OpenSSL::SSL::SSLContext.min_version =
的用法。
用法
min_version = OpenSSL::SSL::TLS1_2_VERSION
min_version = :TLS1_2
min_version = nil
設置支持的 SSL/TLS 協議版本的下限。版本可以由一個名為 OpenSSL::SSL::*_VERSION 的整數常量、一個 Symbol
或 nil
指定,這意味著 “any version”。
請注意不要在調用 min_version=
或 max_version=
後通過 options=
覆蓋 OpenSSL::SSL::OP_NO_{SSL,TLS}v* 選項。
示例
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
相關用法
- Ruby SSLContext.add_certificate用法及代碼示例
- Ruby SSLContext.renegotiation_cb用法及代碼示例
- Ruby SSLContext.alpn_select_cb用法及代碼示例
- Ruby SSLContext.ecdh_curves =用法及代碼示例
- Ruby SSLContext.alpn_protocols用法及代碼示例
- Ruby SSLContext.tmp_dh =用法及代碼示例
- Ruby SSLContext.npn_protocols用法及代碼示例
- Ruby SSLContext.npn_select_cb用法及代碼示例
- Ruby SSLConfig.new用法及代碼示例
- Ruby SSLSocket.open用法及代碼示例
- Ruby SSLSocket.accept_nonblock用法及代碼示例
- Ruby SSLSocket.connect_nonblock用法及代碼示例
- Ruby Symbol capitalize用法及代碼示例
- Ruby SizedQueue clear()用法及代碼示例
- Ruby Spotter.spot_op_asgn2_for_name用法及代碼示例
- Ruby StringScanner skip_until用法及代碼示例
- Ruby StringScanner search_full用法及代碼示例
- Ruby String.match?用法及代碼示例
- Ruby StringScanner.beginning_of_line?用法及代碼示例
- Ruby Stat.stat <=>用法及代碼示例
- Ruby Symbol.to_proc用法及代碼示例
- Ruby Symbol.end_with?用法及代碼示例
- Ruby StringScanner restsize用法及代碼示例
- Ruby Spotter.spot_opcall_for_name用法及代碼示例
- Ruby Set flatten()用法及代碼示例
注:本文由純淨天空篩選整理自ruby-lang.org大神的英文原創作品 SSLContext.min_version =。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。