Ruby 2.1.3使用SSLv23
作爲默認值。你可以在你的IRB控制檯檢查:
> require 'openssl'
# => true
> OpenSSL::SSL::SSLContext::DEFAULT_PARAMS
# => {
# => :ssl_version => "SSLv23",
# => :verify_mode => 1,
# => :ciphers => "ALL:!ADH:!EXPORT:!SSLv2:RC4+RSA:+HIGH:+MEDIUM:+LOW",
# => :options => -2147482625
# => }
順便說一句還有另外一個常量,告訴你所有可用的SSL/TLS方法:
> OpenSSL::SSL::SSLContext::METHODS
# => [
# => [ 0] :TLSv1,
# => [ 1] :TLSv1_server,
# => [ 2] :TLSv1_client,
# => [ 3] :TLSv1_2,
# => [ 4] :TLSv1_2_server,
# => [ 5] :TLSv1_2_client,
# => [ 6] :TLSv1_1,
# => [ 7] :TLSv1_1_server,
# => [ 8] :TLSv1_1_client,
# => [ 9] :SSLv3,
# => [10] :SSLv3_server,
# => [11] :SSLv3_client,
# => [12] :SSLv23,
# => [13] :SSLv23_server,
# => [14] :SSLv23_client
# => ]
見:http://ruby-doc.org/stdlib-2.1.3/libdoc/openssl/rdoc/OpenSSL/SSL/SSLContext.html#constants-list
由於一噸1)問題儘管我相信我不必擔心顯式更改SSL_version,如果服務器在TLSv1中返回Hello消息,那麼openssl會實際上使用期望的TLSv1協議進行通信,因此我是正確的 – Ratatouille 2014-10-29 12:15:40
上述引用來自[這裏](HTTPS:/ /www.mail-archive.com/[email protected]/msg75398.html) – Ratatouille 2014-10-29 12:21:04