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 requests broken #2214

Closed
WebFreak001 opened this Issue Sep 30, 2018 · 12 comments

Comments

Projects
None yet
4 participants
@WebFreak001
Copy link
Contributor

commented Sep 30, 2018

vibe-d 0.8.4
openssl 1.1.1

It just suddenly stopped working without even recompiling my applications.

#!/usr/bin/env dub
/+ dub.sdl:
name "hello_vibed"
dependency "vibe-d" version="~>0.8.4"
dependency "vibe-d:tls" version="~>0.8.4"
subConfiguration "vibe-d:tls" "openssl-1.1"
+/

import vibe.vibe;

void main()
{
	requestHTTP("https://www.google.com", null, (scope res) {
		logInfo("Got: %s", res.bodyReader.readAllUTF8);
	});
	runApplication();
}
Running ./test --vvvv
[2018-09-30 08:47:53.955 D9CF833C(----) trc] create driver core
[2018-09-30 08:47:53.955 main(----) dbg] Initializing OpenSSL...
[2018-09-30 08:47:53.956 main(----) dbg] ... done.
[2018-09-30 08:47:53.956 main(----) dbg] Create HTTP client pool www.google.com:443 true proxy :0
[2018-09-30 08:47:53.956 main(----) dbg] creating new HTTPClient connection, all 0 are in use
[2018-09-30 08:47:53.957 main(----) dbg]  ... 7F1572926400
[2018-09-30 08:47:53.957 main(----) dbg] Now got 1 connections
[2018-09-30 08:47:53.975 72921A15(----) dbg] Thread exit  (index 1) (main=false)
object.Exception@../../.dub/packages/vibe-d-0.8.4/vibe-d/tls/vibe/stream/openssl.d(381): Connecting TLS tunnel:  (0)
----------------
../../.dub/packages/vibe-d-0.8.4/vibe-d/tls/vibe/stream/openssl.d:381 @safe int vibe.stream.openssl.OpenSSLStream.enforceSSL(int, immutable(char)[]) [0xd99ed250]
../../.dub/packages/vibe-d-0.8.4/vibe-d/tls/vibe/stream/openssl.d:339 @safe int vibe.stream.openssl.OpenSSLStream.checkSSLRet(int, immutable(char)[]) [0xd99ecd3c]
../../.dub/packages/vibe-d-0.8.4/vibe-d/tls/vibe/stream/openssl.d:167 @safe vibe.stream.openssl.OpenSSLStream vibe.stream.openssl.OpenSSLStream.__ctor(vibe.internal.interfaceproxy.InterfaceProxy!(vibe.core.stream.Stream).InterfaceProxy, vibe.stream.openssl.OpenSSLContext, vibe.stream.tls.TLSStreamState, immutable(char)[], vibe.core.net.NetworkAddress, immutable(char)[][]) [0xd99ebe7e]
../../.dub/packages/vibe-d-0.8.4/vibe-d/tls/vibe/stream/openssl.d:672 @safe vibe.stream.openssl.OpenSSLStream vibe.stream.openssl.OpenSSLContext.createStream(vibe.internal.interfaceproxy.InterfaceProxy!(vibe.core.stream.Stream).InterfaceProxy, vibe.stream.tls.TLSStreamState, immutable(char)[], vibe.core.net.NetworkAddress) [0xd99ee079]
/home/webfreak/.dub/packages/vibe-d-0.8.4/vibe-d/tls/vibe/stream/tls.d:145 @safe vibe.stream.tls.TLSStream vibe.stream.tls.createTLSStream!(vibe.core.net.TCPConnection).createTLSStream(vibe.core.net.TCPConnection, vibe.stream.tls.TLSContext, vibe.stream.tls.TLSStreamState, immutable(char)[], vibe.core.net.NetworkAddress) [0xd9899ba2]
../../.dub/packages/vibe-d-0.8.4/vibe-d/http/vibe/http/client.d:630 @safe bool vibe.http.client.HTTPClient.doRequest(scope void delegate(vibe.http.client.HTTPClientRequest), ref bool, bool, std.datetime.systime.SysTime) [0xd9907c86]
../../.dub/packages/vibe-d-0.8.4/vibe-d/http/vibe/http/client.d:537 @safe bool vibe.http.client.HTTPClient.doRequestWithRetry(scope void delegate(vibe.http.client.HTTPClientRequest), bool, out bool, out std.datetime.systime.SysTime) [0xd990770e]
../../.dub/packages/vibe-d-0.8.4/vibe-d/http/vibe/http/client.d:471 @trusted void vibe.http.client.HTTPClient.request(scope void delegate(scope vibe.http.client.HTTPClientRequest), scope void delegate(scope vibe.http.client.HTTPClientResponse)) [0xd99070d5]
../../.dub/packages/vibe-d-0.8.4/vibe-d/http/vibe/http/client.d:182 @safe void vibe.http.client.requestHTTP(vibe.inet.url.URL, void delegate(scope vibe.http.client.HTTPClientRequest), scope void delegate(scope vibe.http.client.HTTPClientResponse), const(vibe.http.client.HTTPClientSettings)) [0xd9905fb8]
../../.dub/packages/vibe-d-0.8.4/vibe-d/http/vibe/http/client.d:137 @safe void vibe.http.client.requestHTTP(immutable(char)[], scope void delegate(scope vibe.http.client.HTTPClientRequest), scope void delegate(scope vibe.http.client.HTTPClientResponse), const(vibe.http.client.HTTPClientSettings)) [0xd9905d8f]
source/app.d:5 _Dmain [0xd98762cd]
[2018-09-30 08:47:53.997 main(----) dbg] Thread exit main (index 0) (main=true)
[2018-09-30 08:47:53.997 main(----) dia] Main thread exiting
Program exited with code 1
@s-ludwig

This comment has been minimized.

Copy link
Member

commented Sep 30, 2018

Looks like this is some protocol level error happening. Usually there should be an error message, but it seems like this one is not received using the ERR_ functions. According to the documetation, SSL_get_error needs to be used to retrieve the error in case of SSL_connect.

@WebFreak001

This comment has been minimized.

Copy link
Contributor Author

commented Sep 30, 2018

could it be an issue with OpenSSL 1.1.1?

@WebFreak001

This comment has been minimized.

Copy link
Contributor Author

commented Sep 30, 2018

Error when using vibe-d:tls/botan

[2018-09-30 09:24:38.790 0CE3CFFE(----) trc] create driver core
[2018-09-30 09:24:38.790 main(----) dbg] Create HTTP client pool www.google.com:443 true proxy :0
[2018-09-30 09:24:38.790 main(----) dbg] creating new HTTPClient connection, all 0 are in use
[2018-09-30 09:24:38.803 main(----) dbg]  ... 7FD1E4DD9400
[2018-09-30 09:24:38.803 main(----) dbg] Now got 1 connections
[2018-09-30 09:24:38.820 E4DF28D1(----) dbg] Thread exit  (index 1) (main=false)
[2018-09-30 09:24:38.846 main(----) trc] Socket 11, read 7 bytes: ok
[2018-09-30 09:24:38.846 main(----) trc] --------------------
[2018-09-30 09:24:38.847 main(----) trc] HTTP client request:
[2018-09-30 09:24:38.847 main(----) trc] --------------------
[2018-09-30 09:24:38.847 main(----) trc] GET / HTTP/1.1
[2018-09-30 09:24:38.847 main(----) trc] User-Agent: vibe.d/1.4.1 (HTTPClient, +http://vibed.org/)
[2018-09-30 09:24:38.847 main(----) trc] Connection: keep-alive
[2018-09-30 09:24:38.847 main(----) trc] Accept-Encoding: gzip, deflate
[2018-09-30 09:24:38.847 main(----) trc] Host: www.google.com
[2018-09-30 09:24:38.847 main(----) trc] --------------------
object.Exception@/home/webfreak/.dub/packages/vibe-d-0.8.4/vibe-d/tls/vibe/stream/botan.d(246): TLS Alert Received: illegal_parameter
----------------
/home/webfreak/.dub/packages/vibe-d-0.8.4/vibe-d/tls/vibe/stream/botan.d:239 @safe void vibe.stream.botan.BotanTLSStream.processException() [0xc73721f]
/home/webfreak/.dub/packages/vibe-d-0.8.4/vibe-d/tls/vibe/stream/botan.d:178 @safe ulong vibe.stream.botan.BotanTLSStream.write(const(ubyte[]), eventcore.driver.IOMode)[0xc736dea]
/home/webfreak/.dub/packages/vibe-core-1.4.3/vibe-core/source/vibe/core/stream.d:180 @safe void vibe.core.stream.OutputStream.write(const(ubyte[])) [0xca067a2]
/home/webfreak/.dub/packages/vibe-core-1.4.3/vibe-core/source/vibe/internal/interfaceproxy.d-mixin-302:302 @safe void vibe.internal.interfaceproxy.InterfaceProxy!(vibe.core.stream.Stream).InterfaceProxy.ProxyImpl!(vibe.stream.tls.TLSStream).ProxyImpl.__mixin8.__mixin3.__mixin3.__mixin3.__mixin3.__mixin3.__mixin2.write(void[], const(ubyte[])) [0xc5e639b]
/home/webfreak/.dub/packages/vibe-core-1.4.3/vibe-core/source/vibe/internal/interfaceproxy.d-mixin-191:191 @safe void vibe.internal.interfaceproxy.InterfaceProxy!(vibe.core.stream.Stream).InterfaceProxy.__mixin22.__mixin3.__mixin3.__mixin3.__mixin3.__mixin3.__mixin2.write(const(ubyte[])) [0xc5db765]
/home/webfreak/.dub/packages/vibe-d-0.8.4/vibe-d/stream/vibe/stream/wrapper.d:318 @safe void vibe.stream.wrapper.StreamOutputRange!(vibe.internal.interfaceproxy.InterfaceProxy!(vibe.core.stream.Stream).InterfaceProxy, 1024uL).StreamOutputRange.flush() [0xc684705]
/home/webfreak/.dub/packages/vibe-d-0.8.4/vibe-d/stream/vibe/stream/wrapper.d:312 @safe void vibe.stream.wrapper.StreamOutputRange!(vibe.internal.interfaceproxy.InterfaceProxy!(vibe.core.stream.Stream).InterfaceProxy, 1024uL).StreamOutputRange.__dtor() [0xc6846a8]
/home/webfreak/.dub/packages/vibe-d-0.8.4/vibe-d/stream/vibe/stream/wrapper.d:310 @trusted void vibe.stream.wrapper.StreamOutputRange!(vibe.internal.interfaceproxy.InterfaceProxy!(vibe.core.stream.Stream).InterfaceProxy, 1024uL).StreamOutputRange.__aggrDtor() [0xc684a2c]
/home/webfreak/.dub/packages/vibe-d-0.8.4/vibe-d/http/vibe/http/client.d:835 @safe void vibe.http.client.HTTPClientRequest.writeHeader() [0xc653d81]
/home/webfreak/.dub/packages/vibe-d-0.8.4/vibe-d/http/vibe/http/client.d:857 @safe void vibe.http.client.HTTPClientRequest.finalize() [0xc653eed]
/home/webfreak/.dub/packages/vibe-d-0.8.4/vibe-d/http/vibe/http/client.d:669 @trusted bool vibe.http.client.HTTPClient.doRequest(scope void delegate(vibe.http.client.HTTPClientRequest), ref bool, bool, std.datetime.systime.SysTime).__lambda8() [0xc65306f]
/home/webfreak/.dub/packages/vibe-d-0.8.4/vibe-d/http/vibe/http/client.d:639 @safe bool vibe.http.client.HTTPClient.doRequest(scope void delegate(vibe.http.client.HTTPClientRequest), ref bool, bool, std.datetime.systime.SysTime) [0xc652915]
/home/webfreak/.dub/packages/vibe-d-0.8.4/vibe-d/http/vibe/http/client.d:537 @safe bool vibe.http.client.HTTPClient.doRequestWithRetry(scope void delegate(vibe.http.client.HTTPClientRequest), bool, out bool, out std.datetime.systime.SysTime) [0xc6522ee]
/home/webfreak/.dub/packages/vibe-d-0.8.4/vibe-d/http/vibe/http/client.d:471 @trusted void vibe.http.client.HTTPClient.request(scope void delegate(scope vibe.http.client.HTTPClientRequest), scope void delegate(scope vibe.http.client.HTTPClientResponse)) [0xc651cb5]
/home/webfreak/.dub/packages/vibe-d-0.8.4/vibe-d/http/vibe/http/client.d:182 @safe void vibe.http.client.requestHTTP(vibe.inet.url.URL, void delegate(scope vibe.http.client.HTTPClientRequest), scope void delegate(scope vibe.http.client.HTTPClientResponse), const(vibe.http.client.HTTPClientSettings)) [0xc650b98]
/home/webfreak/.dub/packages/vibe-d-0.8.4/vibe-d/http/vibe/http/client.d:137 @safe void vibe.http.client.requestHTTP(immutable(char)[], scope void delegate(scope vibe.http.client.HTTPClientRequest), scope void delegate(scope vibe.http.client.HTTPClientResponse), const(vibe.http.client.HTTPClientSettings)) [0xc65096f]
source/app.d:5 _Dmain [0xc5c0ead]
[2018-09-30 09:24:38.871 main(----) dbg] Thread exit main (index 0) (main=true)
[2018-09-30 09:24:38.871 main(----) dia] Main thread exiting
Program exited with code 1

Error with vibe-d:tls/openssl-1.1 vibe-d:core/libevent

Running ./test --vvvv
[003B4318:00000000 trc] create driver core
[003B4318:00000000 trc] create driver
[003B4318:00000000 dia] libevent version: 7F5FEBE2C607
[003B4318:00000000 dia] libevent is using 7F5FEBE2E036 for events.
[003B4318:00000000 trc] driver vibe.core.drivers.libevent2.Libevent2Driver created
[003B4318:00000000 dbg] Initializing OpenSSL...
[003B4318:00000000 dbg] ... done.
[003B4318:00000000 dbg] Create HTTP client pool www.google.com:443 true proxy :0
[003B4318:00000000 dbg] creating new HTTPClient connection, all 0 are in use
[003B4318:00000000 dbg]  ... 7F5FEB5F3E80
[003B4318:00000000 dbg] Now got 1 connections
[003B4318:00000000 dbg] dnsresolve www.google.com
[003B4318:00000000 dbg] dnsresolve yield
[003B4318:00000000 dbg] dnsresolve ret
[003B4318:00000000 dbg] Socket event on fd 10: 128 (5590006B08F8 vs 5590006B08F8)
[003B4318:00000000 trc] Connect result status: 128
[003B4318:00000000 trc] evbuffer_add (fd 10): 334 B
[003B4318:00000000 dbg] TCP close request true open
[003B4318:00000000 dia] Actively closing TCP connection
[003B4318:00000000 trc] Closing socket 10...
[003B4318:00000000 trc] socket 10 write event (true)!
[003B4318:00000000 trc] ...socket 10 closed.
object.Exception@/home/webfreak/.dub/packages/vibe-d-0.8.4/vibe-d/tls/vibe/stream/openssl.d(381): Connecting TLS tunnel:  (0)
----------------
/home/webfreak/.dub/packages/vibe-d-0.8.4/vibe-d/tls/vibe/stream/openssl.d:381 @safe int vibe.stream.openssl.OpenSSLStream.enforceSSL(int, immutable(char)[]) [0xaaeac]
/home/webfreak/.dub/packages/vibe-d-0.8.4/vibe-d/tls/vibe/stream/openssl.d:339 @safe int vibe.stream.openssl.OpenSSLStream.checkSSLRet(int, immutable(char)[]) [0xaa998]
/home/webfreak/.dub/packages/vibe-d-0.8.4/vibe-d/tls/vibe/stream/openssl.d:167 @safe vibe.stream.openssl.OpenSSLStream vibe.stream.openssl.OpenSSLStream.__ctor(vibe.core.stream.Stream, vibe.stream.openssl.OpenSSLContext, vibe.stream.tls.TLSStreamState, immutable(char)[], vibe.core.net.NetworkAddress, immutable(char)[][]) [0xa9b91]
/home/webfreak/.dub/packages/vibe-d-0.8.4/vibe-d/tls/vibe/stream/openssl.d:672 @safe vibe.stream.openssl.OpenSSLStream vibe.stream.openssl.OpenSSLContext.createStream(vibe.core.stream.Stream, vibe.stream.tls.TLSStreamState, immutable(char)[], vibe.core.net.NetworkAddress) [0xabc52]
/home/webfreak/.dub/packages/vibe-d-0.8.4/vibe-d/tls/vibe/stream/tls.d:145 @safe vibe.stream.tls.TLSStream vibe.stream.tls.createTLSStream!(vibe.core.net.TCPConnection).createTLSStream(vibe.core.net.TCPConnection, vibe.stream.tls.TLSContext, vibe.stream.tls.TLSStreamState, immutable(char)[], vibe.core.net.NetworkAddress) [0xfff7007f]
/home/webfreak/.dub/packages/vibe-d-0.8.4/vibe-d/http/vibe/http/client.d:630 @safe bool vibe.http.client.HTTPClient.doRequest(scope void delegate(vibe.http.client.HTTPClientRequest), ref bool, bool, std.datetime.systime.SysTime) [0xfffda074]
/home/webfreak/.dub/packages/vibe-d-0.8.4/vibe-d/http/vibe/http/client.d:537 @safe bool vibe.http.client.HTTPClient.doRequestWithRetry(scope void delegate(vibe.http.client.HTTPClientRequest), bool, out bool, out std.datetime.systime.SysTime) [0xfffd9ad9]
/home/webfreak/.dub/packages/vibe-d-0.8.4/vibe-d/http/vibe/http/client.d:471 @trusted void vibe.http.client.HTTPClient.request(scope void delegate(scope vibe.http.client.HTTPClientRequest), scope void delegate(scope vibe.http.client.HTTPClientResponse)) [0xfffd94b1]
/home/webfreak/.dub/packages/vibe-d-0.8.4/vibe-d/http/vibe/http/client.d:182 @safe void vibe.http.client.requestHTTP(vibe.inet.url.URL, void delegate(scope vibe.http.client.HTTPClientRequest), scope void delegate(scope vibe.http.client.HTTPClientResponse), const(vibe.http.client.HTTPClientSettings)) [0xfffd8456]
/home/webfreak/.dub/packages/vibe-d-0.8.4/vibe-d/http/vibe/http/client.d:137 @safe void vibe.http.client.requestHTTP(immutable(char)[], scope void delegate(scope vibe.http.client.HTTPClientRequest), scope void delegate(scope vibe.http.client.HTTPClientResponse), const(vibe.http.client.HTTPClientSettings)) [0xfffd8183]
source/app.d:5 _Dmain [0xfff5547d]
[003B4318:00000000 dia] Main thread exiting
Program exited with code 1

Error when using vibe-d:tls/botan vibe-d:core/libevent

Running ./test --vvvv
[51D53D31:00000000 trc] create driver core
[51D53D31:00000000 trc] create driver
[51D53D31:00000000 dia] libevent version: 7F2AF9C0A607
[51D53D31:00000000 dia] libevent is using 7F2AF9C0C036 for events.
[51D53D31:00000000 trc] driver vibe.core.drivers.libevent2.Libevent2Driver created
[51D53D31:00000000 dbg] Create HTTP client pool www.google.com:443 true proxy :0
[51D53D31:00000000 dbg] creating new HTTPClient connection, all 0 are in use
[51D53D31:00000000 dbg]  ... 7F2AF9462900
[51D53D31:00000000 dbg] Now got 1 connections
[51D53D31:00000000 dbg] dnsresolve www.google.com
[51D53D31:00000000 dbg] dnsresolve yield
[51D53D31:00000000 dbg] dnsresolve ret
[51D53D31:00000000 dbg] Socket event on fd 10: 128 (55A953B7B328 vs 55A953B7B328)
[51D53D31:00000000 trc] Connect result status: 128
[51D53D31:00000000 trc] evbuffer_add (fd 10): 345 B
[51D53D31:00000000 trc] socket 10 write event (false)!
[51D53D31:00000000 trc] socket 10 read event!
[51D53D31:00000000 trc] --------------------
[51D53D31:00000000 trc] HTTP client request:
[51D53D31:00000000 trc] --------------------
[51D53D31:00000000 trc] GET / HTTP/1.1
[51D53D31:00000000 trc] User-Agent: vibe.d/0.8.4 (HTTPClient, +http://vibed.org/)
[51D53D31:00000000 trc] Connection: keep-alive
[51D53D31:00000000 trc] Accept-Encoding: gzip, deflate
[51D53D31:00000000 trc] Host: www.google.com
[51D53D31:00000000 trc] --------------------
object.Exception@/home/webfreak/.dub/packages/vibe-d-0.8.4/vibe-d/tls/vibe/stream/botan.d(246): TLS Alert Received: illegal_parameter
----------------
/home/webfreak/.dub/packages/vibe-d-0.8.4/vibe-d/tls/vibe/stream/botan.d:239 @safe void vibe.stream.botan.BotanTLSStream.processException() [0x51660267]
/home/webfreak/.dub/packages/vibe-d-0.8.4/vibe-d/tls/vibe/stream/botan.d:178 @safe ulong vibe.stream.botan.BotanTLSStream.write(const(ubyte[]), vibe.core.stream.IOMode)[0x5165fe06]
../../.dub/packages/vibe-d-0.8.4/vibe-d/core/vibe/core/stream.d:136 @safe void vibe.core.stream.OutputStream.write(const(ubyte[])) [0x5194dfba]
/home/webfreak/.dub/packages/vibe-d-0.8.4/vibe-d/stream/vibe/stream/wrapper.d:318 @safe void vibe.stream.wrapper.StreamOutputRange!(vibe.core.stream.Stream, 1024uL).StreamOutputRange.flush() [0x515bdcb6]
/home/webfreak/.dub/packages/vibe-d-0.8.4/vibe-d/stream/vibe/stream/wrapper.d:312 @safe void vibe.stream.wrapper.StreamOutputRange!(vibe.core.stream.Stream, 1024uL).StreamOutputRange.__dtor() [0x515bdc58]
/home/webfreak/.dub/packages/vibe-d-0.8.4/vibe-d/http/vibe/http/client.d:835 @safe void vibe.http.client.HTTPClientRequest.writeHeader() [0x51590e4c]
/home/webfreak/.dub/packages/vibe-d-0.8.4/vibe-d/http/vibe/http/client.d:857 @safe void vibe.http.client.HTTPClientRequest.finalize() [0x51590f90]
/home/webfreak/.dub/packages/vibe-d-0.8.4/vibe-d/http/vibe/http/client.d:669 @trusted bool vibe.http.client.HTTPClient.doRequest(scope void delegate(vibe.http.client.HTTPClientRequest), ref bool, bool, std.datetime.systime.SysTime).__lambda10() [0x515904b7]
/home/webfreak/.dub/packages/vibe-d-0.8.4/vibe-d/http/vibe/http/client.d:639 @safe bool vibe.http.client.HTTPClient.doRequest(scope void delegate(vibe.http.client.HTTPClientRequest), ref bool, bool, std.datetime.systime.SysTime) [0x5158fcfd]
/home/webfreak/.dub/packages/vibe-d-0.8.4/vibe-d/http/vibe/http/client.d:537 @safe bool vibe.http.client.HTTPClient.doRequestWithRetry(scope void delegate(vibe.http.client.HTTPClientRequest), bool, out bool, out std.datetime.systime.SysTime) [0x5158f6b9]
/home/webfreak/.dub/packages/vibe-d-0.8.4/vibe-d/http/vibe/http/client.d:471 @trusted void vibe.http.client.HTTPClient.request(scope void delegate(scope vibe.http.client.HTTPClientRequest), scope void delegate(scope vibe.http.client.HTTPClientResponse)) [0x5158f091]
/home/webfreak/.dub/packages/vibe-d-0.8.4/vibe-d/http/vibe/http/client.d:182 @safe void vibe.http.client.requestHTTP(vibe.inet.url.URL, void delegate(scope vibe.http.client.HTTPClientRequest), scope void delegate(scope vibe.http.client.HTTPClientResponse), const(vibe.http.client.HTTPClientSettings)) [0x5158e036]
/home/webfreak/.dub/packages/vibe-d-0.8.4/vibe-d/http/vibe/http/client.d:137 @safe void vibe.http.client.requestHTTP(immutable(char)[], scope void delegate(scope vibe.http.client.HTTPClientRequest), scope void delegate(scope vibe.http.client.HTTPClientResponse), const(vibe.http.client.HTTPClientSettings)) [0x5158dd63]
source/app.d:5 _Dmain [0x5150b05d]
[51D53D31:00000000 dia] Main thread exiting
Program exited with code 1
@WebFreak001

This comment has been minimized.

Copy link
Contributor Author

commented Sep 30, 2018

Could reproduce on another machine with botan but it worked with openssl 1.1.0.i

I don't want to update to openssl 1.1.1 on my server if it means the requests will all break

@Vild

This comment has been minimized.

Copy link
Contributor

commented Sep 30, 2018

I can reproduce it using the code @WebFreak001 provided.

name "test"

dependency "vibe-d" version="~>0.8.4"
dependency "vibe-d:tls" version="~>0.8.4"
subConfiguration "vibe-d:tls" "openssl-1.1"
object.Exception@/home/wild/.dub/packages/vibe-d-0.8.4/vibe-d/tls/vibe/stream/openssl.d(381): Connecting TLS tunnel:  (0)
----------------
/home/wild/.dub/packages/vibe-d-0.8.4/vibe-d/tls/vibe/stream/openssl.d:381 @safe int vibe.stream.openssl.OpenSSLStream.enforceSSL(int, immutable(char)[]) [0xc1aa1518]
/home/wild/.dub/packages/vibe-d-0.8.4/vibe-d/tls/vibe/stream/openssl.d:339 @safe int vibe.stream.openssl.OpenSSLStream.checkSSLRet(int, immutable(char)[]) [0xc1aa1004]
/home/wild/.dub/packages/vibe-d-0.8.4/vibe-d/tls/vibe/stream/openssl.d:167 @safe vibe.stream.openssl.OpenSSLStream vibe.stream.openssl.OpenSSLStream.__ctor(vibe.internal.interfaceproxy.InterfaceProxy!(vibe.core.stream.Stream).InterfaceProxy, vibe.stream.openssl.OpenSSLContext, vibe.stream.tls.TLSStreamState, immutable(char)[], vibe.core.net.NetworkAddress, immutable(char)[][]) [0xc1aa0146]
/home/wild/.dub/packages/vibe-d-0.8.4/vibe-d/tls/vibe/stream/openssl.d:672 @safe vibe.stream.openssl.OpenSSLStream vibe.stream.openssl.OpenSSLContext.createStream(vibe.internal.interfaceproxy.InterfaceProxy!(vibe.core.stream.Stream).InterfaceProxy, vibe.stream.tls.TLSStreamState, immutable(char)[], vibe.core.net.NetworkAddress) [0xc1aa2341]
/home/wild/.dub/packages/vibe-d-0.8.4/vibe-d/tls/vibe/stream/tls.d:145 @safe vibe.stream.tls.TLSStream vibe.stream.tls.createTLSStream!(vibe.core.net.TCPConnection).createTLSStream(vibe.core.net.TCPConnection, vibe.stream.tls.TLSContext, vibe.stream.tls.TLSStreamState, immutable(char)[], vibe.core.net.NetworkAddress) [0xc194e186]
/home/wild/.dub/packages/vibe-d-0.8.4/vibe-d/http/vibe/http/client.d:630 @safe bool vibe.http.client.HTTPClient.doRequest(scope void delegate(vibe.http.client.HTTPClientRequest), ref bool, bool, std.datetime.systime.SysTime) [0xc19bc26a]
/home/wild/.dub/packages/vibe-d-0.8.4/vibe-d/http/vibe/http/client.d:537 @safe bool vibe.http.client.HTTPClient.doRequestWithRetry(scope void delegate(vibe.http.client.HTTPClientRequest), bool, out bool, out std.datetime.systime.SysTime) [0xc19bbcf2]
/home/wild/.dub/packages/vibe-d-0.8.4/vibe-d/http/vibe/http/client.d:471 @trusted void vibe.http.client.HTTPClient.request(scope void delegate(scope vibe.http.client.HTTPClientRequest), scope void delegate(scope vibe.http.client.HTTPClientResponse)) [0xc19bb6b9]
/home/wild/.dub/packages/vibe-d-0.8.4/vibe-d/http/vibe/http/client.d:182 @safe void vibe.http.client.requestHTTP(vibe.inet.url.URL, void delegate(scope vibe.http.client.HTTPClientRequest), scope void delegate(scope vibe.http.client.HTTPClientResponse), const(vibe.http.client.HTTPClientSettings)) [0xc19ba59c]
/home/wild/.dub/packages/vibe-d-0.8.4/vibe-d/http/vibe/http/client.d:137 @safe void vibe.http.client.requestHTTP(immutable(char)[], scope void delegate(scope vibe.http.client.HTTPClientRequest), scope void delegate(scope vibe.http.client.HTTPClientResponse), const(vibe.http.client.HTTPClientSettings)) [0xc19ba373]
source/app.d:5 _Dmain [0xc192a8ad]
@WebFreak001

This comment has been minimized.

Copy link
Contributor Author

commented Oct 17, 2018

bump, fatal issue, any clues? Even botan isn't working

@ThomasBrixLarsen

This comment has been minimized.

Copy link

commented Oct 18, 2018

I ended up going back to OpenSSL 1.0 instead.
As described here: #1748 (comment)

@WebFreak001

This comment has been minimized.

Copy link
Contributor Author

commented Oct 19, 2018

great so this hacky workaround begins again, this time being even more fatal because it only happens "silently" at runtime and no longer at linking time.

Plus it requires recompilation of all vibe-d applications because they just break by updating

@WebFreak001

This comment has been minimized.

Copy link
Contributor Author

commented Oct 20, 2018

RIP vibe.d development on Ubuntu, 18.10 ships OpenSSL 1.1.1 now which will break https there too

@WebFreak001

This comment has been minimized.

Copy link
Contributor Author

commented Oct 26, 2018

I found out that the issue is not SSL_ERROR_SSL, but SSL_ERROR_SYSCALL which means:

Some non-recoverable I/O error occurred. The OpenSSL error queue may contain more information on the error. For socket I/O on Unix systems, consult errno for details.

However when checking what errno contains it is 0 (Success) and there is no previous SSL error in the error stack when calling SSL_connect.

@WebFreak001

This comment has been minimized.

Copy link
Contributor Author

commented Oct 26, 2018

Issue found: the (now opaque) BIO struct is manually read and written by the bio callbacks plus the callbacks struct is also manually written. Replacing them with appropriate getter/setters and removing the num = -1 set and creating the BIO using the appropriate create meth methods fixes it.

WebFreak001 added a commit to WebFreak001/vibe.d that referenced this issue Oct 26, 2018

Use new BIO methods, more error handling
Also changes minimum protocol version to new API
Split the error handling API to be more usable
Fix IO error message
fix vibe-d#2214
@WebFreak001

This comment has been minimized.

Copy link
Contributor Author

commented Nov 3, 2018

fixed itself on arch. The PR should still get merged to fix deprecated API usage

s-ludwig added a commit that referenced this issue Nov 7, 2018

Merge pull request #2226 from WebFreak001/fix-openssl111
Fix OpenSSL 1.1.1 by using new APIs. Fixes #2214.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.