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

Does HTTPotion Support SNI? #119

Closed
Preen opened this issue Jan 30, 2018 · 4 comments
Closed

Does HTTPotion Support SNI? #119

Preen opened this issue Jan 30, 2018 · 4 comments

Comments

@Preen
Copy link

Preen commented Jan 30, 2018

Getting handshake failure when I try to use it against aws cloudfront which currently (if you pick the free version of certificate) only allows clients that supports SNI.

%HTTPotion.ErrorResponse{message: "{:tls_alert, 'handshake failure'}"}

@valpackett
Copy link
Owner

It should work I think…

What Erlang version are you using? Are you using an HTTP proxy? Can you connect to that domain with raw ssl module? like :ssl.connect('example.com', 443, [])

@Preen
Copy link
Author

Preen commented Feb 9, 2018

I want to be able to specify ssl version. With HTTPoision this works.

# Either use this

HTTPoison.get("https://example.com/", [], [ssl: [{:versions, [:'tlsv1.2']}]])

# or worst case:

HTTPoison.get("https://example.com/", [], [ssl: [{:verify, :verify_none}]])

@Preen Preen closed this as completed Feb 9, 2018
@Preen Preen reopened this Feb 9, 2018
@valpackett
Copy link
Owner

Damn, Erlang ssl's behavior is so weird, why does it only automatically set SNI if you force TLS 1.2 o_0

You can probably do something like that:

HTTPotion.get("https://example.com/", [ibrowse: [ssl_options: [{:versions, [:'tlsv1.2']}]]])

But it seems like you can also pass the hostname as the server_name_indication option instead of TLS 1.2. HTTPotion should automatically do this. I'll implement that soon.

@valpackett
Copy link
Owner

Done. SNI should work automatically on current master.

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

No branches or pull requests

2 participants