Skip to content

Cert verification failure with openssl and curl #18

@bruno-

Description

@bruno-

Hi,

this is a great gem, thank you for making it. I'm using localhost with puma. Connecting to the server via browser works great. The guide does a great job of informing a user how to set this up.

Connecting to the server via Net::HTTP (httparty) fails

$ ruby -e 'require "httparty"; HTTParty.get("https://localhost:3000")'

Output (personal stuff redacted with (...)`:

...3.0.0/lib/ruby/3.0.0/net/protocol.rb:46:in `connect_nonblock': SSL_connect returned=1 errno=0 state=error: certificate verify failed (self signed certificate) (OpenSSL::SSL::SSLError)
        from ...3.0.0/lib/ruby/3.0.0/net/protocol.rb:46:in `ssl_socket_connect'
        from ...3.0.0/lib/ruby/3.0.0/net/http.rb:1038:in `connect'
        from ...3.0.0/lib/ruby/3.0.0/net/http.rb:970:in `do_start'
        from ...3.0.0/lib/ruby/3.0.0/net/http.rb:959:in `start'
        from ...3.0.0/lib/ruby/3.0.0/net/http.rb:1512:in `request'
        from ...3.0.0/lib/ruby/gems/3.0.0/gems/httparty-0.18.1/lib/httparty/request.rb:145:in `perform'
        from ...3.0.0/lib/ruby/gems/3.0.0/gems/httparty-0.18.1/lib/httparty.rb:594:in `perform_request'
        from ...3.0.0/lib/ruby/gems/3.0.0/gems/httparty-0.18.1/lib/httparty.rb:508:in `get'
        from ...3.0.0/lib/ruby/gems/3.0.0/gems/httparty-0.18.1/lib/httparty.rb:627:in `get'

Connecting to the server via curl fails

curl https://localhost:3000 fails with the following error:

curl: (60) SSL certificate problem: self signed certificate
More details here: https://curl.haxx.se/docs/sslcerts.html

curl failed to verify the legitimacy of the server and therefore could not
establish a secure connection to it. To learn more about this situation and
how to fix it, please visit the web page mentioned above.

Is connecting via curl or net-http out of scope for this gem?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions