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

wrong version number #57

Closed
MisterDA opened this issue Oct 29, 2015 · 3 comments
Closed

wrong version number #57

MisterDA opened this issue Oct 29, 2015 · 3 comments

Comments

@MisterDA
Copy link

Hi !
I want to download a file (here the google index) but it fails.

require("socket")
local https = require("ssl.https")
print(https.request("https://www.google.com"))
-- nil  wrong version number    nil nil
require("socket")
local https = require("ssl.https")
local one, code, headers, status = https.request({
  url = "https://www.google.com",
  protocol="sslv3",
  options="all",
  verify="none"})
print(one, code, headers, status)
-- nil  wrong version number    nil nil

This might be related to #34 and #38 ... If I'm not able to download a simple file, well it's bad.
What do I do ?

@daurnimator
Copy link
Contributor

Your computer probably has sslv3 disabled (it's insecure).
Use "tlsv1" instead.

@MisterDA
Copy link
Author

In fact I was testing with "tlsv1_2" and I tried them all, they are all failing.
I also installed the latest development builds from luarocks of luasec and luasocket, I can't get it working.

@brunoos
Copy link
Member

brunoos commented Oct 29, 2015

again... it is luasocket redirect problem...

Google replies with 302 and luasocket tries to connect without SSL/TLS.

$ curl -v https://www.google.com
...
> GET / HTTP/1.1
> Host: www.google.com
> User-Agent: curl/7.44.0
> Accept: */*
> 
< HTTP/1.1 302 Found
< Cache-Control: private
< Content-Type: text/html; charset=UTF-8
< Location: https://www.google.com.br/?gfe_rd=cr&ei=fJYyVryZOqek8wfogZa4Cg
< Content-Length: 263
< Date: Thu, 29 Oct 2015 21:58:20 GMT
< Server: GFE/2.0
< 
<HTML><HEAD><meta http-equiv="content-type" content="text/html;charset=utf-8">
<TITLE>302 Moved</TITLE></HEAD><BODY>
<H1>302 Moved</H1>
The document has moved
<A HREF="https://www.google.com.br/?gfe_rd=cr&amp;ei=fJYyVryZOqek8wfogZa4Cg">here</A>.
</BODY></HTML>
* Connection #0 to host www.google.com left intact

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

No branches or pull requests

3 participants