本文簡要介紹ruby語言中 OpenSSL::SSL::SSLContext.renegotiation_cb
的用法。
用法
renegotiation_cb [讀寫]
每當在已建立的連接上啟動新的握手時調用的回調。可用於完全禁用重新協商。
使用活動的 SSLSocket
調用回調。回調的返回值被忽略。正常返回表示重新協商“approval”,並將繼續該過程。要禁止重新協商並取消進程,請在回調中引發異常。
禁用客戶端重新協商
在運行服務器時,通常希望完全禁用客戶端重新協商。您可以使用如下回調來實現此函數:
ctx.renegotiation_cb = lambda do |ssl|
raise RuntimeError, "Client renegotiation disabled"
end
相關用法
- Ruby SSLContext.add_certificate用法及代碼示例
- Ruby SSLContext.alpn_select_cb用法及代碼示例
- Ruby SSLContext.min_version =用法及代碼示例
- 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.renegotiation_cb。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。