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

Always set OpenSSL default paths #772

Merged
merged 1 commit into from Jan 12, 2022
Merged

Commits on Jan 12, 2022

  1. Always set OpenSSL default paths

    Previously if you set `SSL_CERT_FILE` to a directory with no certs,
    this script would fail:
    
    ```ruby
    require 'openssl'
    require 'excon'
    
    ENV['SSL_CERT_DIR'] = '/path/to/no/ssl/certs/'
    
    excon = Excon.new('https://www.google.com')
    excon.get
    ```
    
    However, the same script with `Net::HTTP` works fine:
    
    ```ruby
    require 'openssl'
    require 'net/http'
    
    ENV['SSL_CERT_DIR'] = '/path/to/no/ssl/certs/'
    
    Net::HTTP.get(URI('https://www.google.com'))
    ```
    
    To match the behavior of Net::HTTP, always call
    `OpenSSL::X509::Store#set_default_paths` unless there is a store
    specified.
    stanhu committed Jan 12, 2022
    Copy the full SHA
    d33be6c View commit details
    Browse the repository at this point in the history