Skip to content

Commit

Permalink
Allow setting min/max SSL version for a Net::HTTP connection on Ruby …
Browse files Browse the repository at this point in the history
…2.5 (#792)
  • Loading branch information
bdewater authored and iMacTia committed May 1, 2018
1 parent 4381c2d commit e7c7990
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions lib/faraday/adapter/net_http.rb
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ def configure_ssl(http, ssl)
http.ca_path = ssl[:ca_path] if ssl[:ca_path]
http.verify_depth = ssl[:verify_depth] if ssl[:verify_depth]
http.ssl_version = ssl[:version] if ssl[:version]
http.min_version = ssl[:min_version] if ssl[:min_version]
http.max_version = ssl[:max_version] if ssl[:max_version]
end

def configure_request(http, req)
Expand Down
3 changes: 2 additions & 1 deletion lib/faraday/options.rb
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,8 @@ def []=(key, value)
end

class SSLOptions < Options.new(:verify, :ca_file, :ca_path, :verify_mode,
:cert_store, :client_cert, :client_key, :certificate, :private_key, :verify_depth, :version)
:cert_store, :client_cert, :client_key, :certificate, :private_key, :verify_depth,
:version, :min_version, :max_version)

def verify?
verify != false
Expand Down

0 comments on commit e7c7990

Please sign in to comment.