tong / hxssl

Haxe→C++/Neko OpenSSL bindings
30 stars 45 forks source link

haxe/Http.hx socket bug #35

Closed maxless closed 10 years ago

maxless commented 10 years ago

Looks like the library is installed with slightly modified haxe/Http.hx file that is not available here. It also has the following bug:

The customRequest() method starting on line 352 has the following code near the start

        var secure = (url_regexp.matched(1) == "https://");
        if( sock == null ) {
            if( secure ) {
...
            } else {
                #if hxssl
                sock = new sys.ssl.Socket();
                #else
                sock = new sys.net.Socket();
                #end
            }
        }

So even if unsecure connection is requested, it will try to open ssl socket and fail. The code in Haxe 3.0.1 has that fixed:

        var secure = (url_regexp.matched(1) == "https://");
        if( sock == null ) {
            if( secure ) {
...
            } else
                sock = new Socket();
        }

Changing hxssl to haxe version will fail the compilation. My application has to have both https and http connections so I have to use hxssl version of Http.hx.

hexonaut commented 10 years ago

I removed the custom Http class in the latest commit. You can check out the code from here to get a working version without clobbering the std lib Http.

@tong Maybe it's time to update the haxelib version?

maxless commented 10 years ago

Okay, the git version works, thanks. But you do need to update the haxelib :)

2014-09-23 22:22 GMT+04:00 Sam notifications@github.com:

I removed the custom Http class in the latest commit. You can check out the code from here to get a working version without clobbering the std lib Http.

@tong https://github.com/tong Maybe it's time to update the haxelib version?

— Reply to this email directly or view it on GitHub https://github.com/tong/hxssl/issues/35#issuecomment-56565863.