Skip to content

ensure to pass hostname when doing an SSL request #763

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

benoitc
Copy link
Owner

@benoitc benoitc commented Feb 26, 2025

fix #759

@luismiramirez
Copy link

I get a connection error now:

Validating Push API key: [hackney trace 80 <0.94.0> 2025:02:27 10:31:10 4677] request 
   Content: [{module,hackney},
             {line,313},
             {method,post},
             {url,
                 {hackney_url,hackney_ssl,https,<<"push.appsignal.com">>,
                     <<"/1/auth?name=&hostname=&api_key=1234&environment=dev">>,
                     <<"/1/auth">>,
                     <<"name=&hostname=&api_key=1234&environment=dev">>,
                     <<>>,"push.appsignal.com",443,<<>>,<<>>}},
             {headers,
                 [{<<"Content-Type">>,<<"application/json; charset=UTF-8">>}]},
             {body,<<>>},
             {options,
                 [{ssl_options,
                      [{verify,verify_peer},
                       {cacertfile,
                           <<"/Users/luismiramirez/code/handshake/_build/dev/lib/appsignal/priv/cacert.pem">>},
                       {versions,['tlsv1.3','tlsv1.2']},
                       {customize_hostname_check,
                           [{match_fun,#Fun<public_key.6.112534691>}]}]},
                  {pool,appsignal_transmitter}]}]
[hackney trace 60 <0.94.0> 2025:02:27 10:31:10 4678] request without proxy 
   Content: [{module,hackney},{line,686}]
[hackney trace 60 <0.94.0> 2025:02:27 10:31:10 4679] connect 
   Content: [{module,hackney_connect},
             {line,32},
             {transport,hackney_ssl},
             {host,"push.appsignal.com"},
             {port,443},
             {dynamic,true}]
[hackney trace 80 <0.94.0> 2025:02:27 10:31:10 4685] no socket in the pool 
   Content: [{module,hackney_pool},{line,88},{pool,appsignal_transmitter}]
[hackney trace 80 <0.94.0> 2025:02:27 10:31:10 4686] connect error 
   Content: [{module,hackney_connect},{line,238}]

Validating failed, reason:

  :checkout_failure

@benoitc
Copy link
Owner Author

benoitc commented Mar 3, 2025

@luismiramirez can you paste me the whole hackney line you're doing ?

@luismiramirez
Copy link

Sure, it'd be something like:

:hackney.request(
      :post,
      "https://push.appsignal.com/auth?name=&hostname=&api_key=1234&environment=dev",
      [{"Content-Type", "application/json; charset=UTF-8"}],
      "",
      pool: :appsignal_transmitter,
      ssl_options: [
        verify: :verify_peer,
        cacertfile:
          "/Users/luismiramirez/code/handshake/_build/dev/lib/appsignal/priv/cacert.pem",
        versions: ["tlsv1.3", "tlsv1.2"],
        customize_hostname_check: [
          match_fun: :public_key.pkix_verify_hostname_match_fun(:https)
        ]
      ]
    )

@benoitc
Copy link
Owner Author

benoitc commented Mar 3, 2025 via email

@luismiramirez
Copy link

Here it is without ssl_options

Validating Push API key: [hackney trace 80 <0.94.0> 2025:03:04 08:01:20 4339] request 
   Content: [{module,hackney},
             {line,313},
             {method,post},
             {url,{hackney_url,hackney_ssl,https,<<"push.appsignal.com">>,
                               <<"/1/auth?name=&hostname=&api_key=1234=dev">>,
                               <<"/1/auth">>,
                               <<"name=&hostname=&api_key=1234&environment=dev">>,
                               <<>>,"push.appsignal.com",443,<<>>,<<>>}},
             {headers,[{<<"Content-Type">>,
                        <<"application/json; charset=UTF-8">>}]},
             {body,<<>>},
             {options,[{pool,appsignal_transmitter}]}]
[hackney trace 60 <0.94.0> 2025:03:04 08:01:20 4341] request without proxy 
   Content: [{module,hackney},{line,686}]
[hackney trace 60 <0.94.0> 2025:03:04 08:01:20 4342] connect 
   Content: [{module,hackney_connect},
             {line,32},
             {transport,hackney_ssl},
             {host,"push.appsignal.com"},
             {port,443},
             {dynamic,true}]

Validating failed, reason:

  :checkout_failure

[hackney trace 80 <0.94.0> 2025:03:04 08:01:20 4372] no socket in the pool 
   Content: [{module,hackney_pool},{line,88},{pool,appsignal_transmitter}]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1.22.0 causes CLIENT ALERT: Fatal - Handshake Failure when sending GET request with TLS options
2 participants