kernelsauce / turbo

Turbo is a framework built for LuaJIT 2 to simplify the task of building fast and scalable network applications. It uses a event-driven, non-blocking, no thread design to deliver excellent performance and minimal footprint to high-load applications while also providing excellent support for embedded uses.
http://turbo.readthedocs.io/
Apache License 2.0
528 stars 84 forks source link

"SSL certficate hostname validation failed" even when SSL validation is turned off #204

Closed fuxoft closed 9 years ago

fuxoft commented 9 years ago

Sorry about potentially stupid question but In release 1.1-4 (Linux), when I try to use HTTPClient for a https: numeric IPv4 address (e.g. "https://149.154.167.200/index.htm"), I get the following error even when I have "verify_ca" parameter set to false, i.e. I don't want validation:

crypto.lua:657: SSL certficate hostname validation failed, rc 1

When using non-numeric address (e.g. "https://api.telegram.org"), there are no errors.

I was implementing my own DNS caching to make my HTTPS requests quicker and now I am puzzled how to use HTTPS requests with numeric addresses. When using numeric HTTPS addresses in Luasocket & LuaSec, it works without errors.

kernelsauce commented 9 years ago

That is strange. I will have a look at it. Thank you for reporting.

kernelsauce commented 9 years ago

Fix is now in v1.1.5 which can be downloaded as tar ball from here, or installed with luarocks (just pushed).

kernelsauce commented 9 years ago

Just to add, this is not pulled upstream as master already had revised code in that section that worked as expected.

fuxoft commented 9 years ago

Seems to work perfeclty now. Thanks.