diff --git a/lib/excon/constants.rb b/lib/excon/constants.rb index 899ebce5..da9e13ae 100644 --- a/lib/excon/constants.rb +++ b/lib/excon/constants.rb @@ -99,6 +99,7 @@ module Excon :ssl_version, :ssl_min_version, :ssl_max_version, + :ssl_security_level, :ssl_proxy_headers, :ssl_uri_schemes, :tcp_nodelay, diff --git a/lib/excon/ssl_socket.rb b/lib/excon/ssl_socket.rb index dceb8cc4..897786f5 100644 --- a/lib/excon/ssl_socket.rb +++ b/lib/excon/ssl_socket.rb @@ -12,6 +12,11 @@ def initialize(data = {}) # create ssl context ssl_context = OpenSSL::SSL::SSLContext.new + # set the security level before setting other parameters affected by it + if @data[:ssl_security_level] + ssl_context.security_level = @data[:ssl_security_level] + end + # disable less secure options, when supported ssl_context_options = OpenSSL::SSL::SSLContext::DEFAULT_PARAMS[:options] if defined?(OpenSSL::SSL::OP_DONT_INSERT_EMPTY_FRAGMENTS)