aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorZachary Scott <e@zzak.io>2015-10-08 14:08:27 +0900
committerZachary Scott <e@zzak.io>2015-10-08 14:08:27 +0900
commita504359950f86f96ef2477920b56027f5b7f4fb2 (patch)
tree241dbb67498851d631302f741b1897d50e61beb0 /lib
parentfccd05e12819ad23aa4c26d7e2f289bca77d8675 (diff)
downloadruby-openssl-a504359950f86f96ef2477920b56027f5b7f4fb2.tar.gz
Prefer TLS v1.2 to follow "secure defaults" and disable TLS v1.0 and v1.1
See ruby/ruby#873.
Diffstat (limited to 'lib')
-rw-r--r--lib/openssl/ssl.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/openssl/ssl.rb b/lib/openssl/ssl.rb
index ed19e09a..308152e5 100644
--- a/lib/openssl/ssl.rb
+++ b/lib/openssl/ssl.rb
@@ -16,7 +16,7 @@ module OpenSSL
module SSL
class SSLContext
DEFAULT_PARAMS = {
- :ssl_version => "SSLv23",
+ :ssl_version => "TLSv1_2",
:verify_mode => OpenSSL::SSL::VERIFY_PEER,
:ciphers => %w{
ECDHE-ECDSA-AES128-GCM-SHA256
@@ -59,6 +59,7 @@ module OpenSSL
opts |= OpenSSL::SSL::OP_NO_COMPRESSION if defined?(OpenSSL::SSL::OP_NO_COMPRESSION)
opts |= OpenSSL::SSL::OP_NO_SSLv2 if defined?(OpenSSL::SSL::OP_NO_SSLv2)
opts |= OpenSSL::SSL::OP_NO_SSLv3 if defined?(OpenSSL::SSL::OP_NO_SSLv3)
+ opts |= OpenSSL::SSL::OP_NO_TLSv1 if defined?(OpenSSL::SSL::OP_NO_TLSv1)
opts
}.call
}