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

HTTPS request fails for some websites (with coro-http) #212

Open
edubart opened this issue Jun 10, 2017 · 1 comment
Open

HTTPS request fails for some websites (with coro-http) #212

edubart opened this issue Jun 10, 2017 · 1 comment

Comments

@edubart
Copy link

edubart commented Jun 10, 2017

I'm using lit's coro-http for doing HTTPS requests, some websites works fine, other ones fails with the error:

Peer aborted the SSL handshake,

I sniffed the handshake TLS packet with wireshark and compared with other library doing HTTPS requests, I found out that the only difference was the hostname option in the TLS handshake. The solution was to add ssl:set('hostname', host) in secure-socket/biowrap.lua

function bioWrap(ctx, isServer, socket, handshakeComplete, host)
  local ssl = ctx:ssl(bin, bout, isServer)
  ssl:set('hostname', host)

where host is the host we are connecting to.

@edubart
Copy link
Author

edubart commented Jun 10, 2017

Related to luvit/luvit#986

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

1 participant