Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ssl_security_level support #752

Merged
merged 1 commit into from Jun 28, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/excon/constants.rb
Expand Up @@ -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,
Expand Down
5 changes: 5 additions & 0 deletions lib/excon/ssl_socket.rb
Expand Up @@ -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)
Expand Down