Skip to content

Commit

Permalink
Merge pull request #772 from stanhu/sh-set-default-paths
Browse files Browse the repository at this point in the history
Always set OpenSSL default paths
  • Loading branch information
geemus committed Jan 12, 2022
2 parents 44cf104 + d33be6c commit c9590a0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/excon/ssl_socket.rb
Expand Up @@ -54,11 +54,13 @@ def initialize(data = {})
ssl_context.cert_store = cert_store
end

# no defaults, fallback to bundled
unless ca_file || ca_path || cert_store
if cert_store.nil?
ssl_context.cert_store = OpenSSL::X509::Store.new
ssl_context.cert_store.set_default_paths
end

# no defaults, fallback to bundled
unless ca_file || ca_path || cert_store
# workaround issue #257 (JRUBY-6970)
ca_file = DEFAULT_CA_FILE
ca_file = ca_file.gsub(/^jar:/, '') if ca_file =~ /^jar:file:\//
Expand Down

0 comments on commit c9590a0

Please sign in to comment.