diff options
author | Eneas U de Queiroz <cotequeiroz@gmail.com> | 2019-09-18 23:18:02 -0300 |
---|---|---|
committer | Hauke Mehrtens <hauke@hauke-m.de> | 2019-09-20 20:48:23 +0200 |
commit | 33308eebda34c90455dbce825fac112a987c0ecd (patch) | |
tree | 36db8dc16f02841c3db2464e8d4cde75ef1ad4f2 /ustream-ssl.c | |
parent | 79d91aa6e7f2fe544a4953fbae1c8bdcdba78099 (diff) | |
download | ustream-ssl-33308eebda34c90455dbce825fac112a987c0ecd.tar.gz |
ustream-io-cyassl.c: fix client-mode connections
Starting in v3.13.2, wolfSSL stores the BIO send and recv callbacks
in the SSL struct. When the SSL session is created, it inherits the
calls from the SSL_CTX, but they do not get updated when the SSL_CTX
callbacks are changed.
Currently, ustream-ssl sets the callbacks after the SSL session is
created, causing failures. Client apps, such as uclient-fetch fail
immediately to connect to https URLs with a 'Connection failed' error
message. uhttpd seems unaffected.
New calls to set them directly to the SSL struct were added in 4.1.0, so
we can use them, with a check in CMakeLists.txt to detect their
presence. Otherwise, another call to ustream_set_io is done before
creating the SSL session to properly set the callbacks.
Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
Diffstat (limited to 'ustream-ssl.c')
-rw-r--r-- | ustream-ssl.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/ustream-ssl.c b/ustream-ssl.c index dd0faf9..e6b084b 100644 --- a/ustream-ssl.c +++ b/ustream-ssl.c @@ -179,6 +179,9 @@ static int _ustream_ssl_init(struct ustream_ssl *us, struct ustream *conn, struc us->conn = conn; us->ctx = ctx; +#if defined(HAVE_WOLFSSL) && defined(NO_WOLFSSL_SSLSETIO_SEND_RECV) + ustream_set_io(ctx, NULL, conn); +#endif us->ssl = __ustream_ssl_session_new(us->ctx); if (!us->ssl) return -ENOMEM; |