Closed Jeronimo17 closed 3 years ago
Thank you for creating this. By default in OpenWrt curl uses WolfSSL, however when compiled to rely on OpenSSL, it connects to the web-site in question just fine:
# curl https://www.boe.es -v
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
* TLSv1.3 (IN), TLS handshake, Server hello (2):
* TLSv1.2 (IN), TLS handshake, Certificate (11):
* TLSv1.2 (IN), TLS handshake, Server finished (14):
* TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
* TLSv1.2 (OUT), TLS change cipher, Change cipher spec (1):
* TLSv1.2 (OUT), TLS handshake, Finished (20):
* TLSv1.2 (IN), TLS handshake, Finished (20):
> GET / HTTP/1.1
> Host: www.boe.es
> User-Agent: curl/7.79.0
> Accept: */*
@neheb @champtar this is not the first time when there were issues with curl's depdendency on WolfSSL, I believe in some cases it causes memory leaks when using https-dns-proxy when the openssl-based version works fine. What would be the proper media to discuss switching to OpenSSL instead?
The original reason for switching to wolfssl was because that's what wpad was switched to in order to support WPA3.
Personally, I'd move it back to the older default of mbedTLS.
This is also not the first time there were issues with wolfSSL. Transmission for example does not work with it.
Checking boe.es with "nmap --script ssl-enum-ciphers -p 443 www.boe.es" shows
TLSv1.0 TLSv1.1 TLSv1.2
For all three nmap emits a warning: "Forward Secrecy not supported by any cipher"
wolfSSL's README says that it no longer supports static key cipher suites by default. I think that forward secrecy means not using a static suite, at least that's what I gather from a few web searches. So to summarize if a host doesn't support forward secrecy then wolfSSL will not be able to connect to it, unless it's compiled with
WOLFSSL_STATIC_DH WOLFSSL_STATIC_RSA WOLFSSL_STATIC_PSK
which OpenWrt doesn't do (and wolfSSL upstream says it's deprecated).
Is this correct?
Sorry for putting this here, a temporary trick for me has been to install the 19.07 version ipk: curl_7.66.0-3_mipsel_24kc.ipk libcurl4_7.66.0-3_mipsel_24kc.ipk libnghttp2-14_1.41.0-1_mipsel_24kc.ipk
Checking boe.es with "nmap --script ssl-enum-ciphers -p 443 www.boe.es" shows
TLSv1.0 TLSv1.1 TLSv1.2
For all three nmap emits a warning: "Forward Secrecy not supported by any cipher"
wolfSSL's README says that it no longer supports static key cipher suites by default. I think that forward secrecy means not using a static suite, at least that's what I gather from a few web searches. So to summarize if a host doesn't support forward secrecy then wolfSSL will not be able to connect to it, unless it's compiled with
WOLFSSL_STATIC_DH WOLFSSL_STATIC_RSA WOLFSSL_STATIC_PSK
which OpenWrt doesn't do (and wolfSSL upstream says it's deprecated).
Is this correct?
wolfSSL README says regarding static key cipher suites: "They also lower your security by removing PFS." So yes, with wolfSSL you can only connect to PFS-enabled sites be default (the site in question is not PFS-enabled).
With default wolfSSL build:
su -s /bin/sh -c "curl https://www.boe.es -v" nobody
* SSL_connect failed with error -313: received alert fatal error
curl: (35) SSL_connect failed with error -313: received alert fatal error
With changed build:
su -s /bin/sh -c "curl https://www.boe.es -v" nobody
> GET / HTTP/1.1
> Host: www.boe.es
> User-Agent: curl/7.78.0
> Accept: */*
>
< HTTP/1.1 200 OK
The only change I made in wolfSSL Makefile was adding "-DWOLFSSL_STATIC_RSA" to TARGET_CFLAGS. I compiled it in an 21.02 SDK.
Making this change in wolfSSL is an alternative to what @stangri is proposing in issue #16674. The size difference in libwolfssl is only 1 KByte:
-rw-r--r-- 1 xy xy 420K 21. Sep 12:59 bin/packages/mips_24kc/base/libwolfssl4.7.0.66253b90_4.7.0-stable-2_mips_24kc.ipk
-rw-r--r-- 1 xy xy 421K 21. Sep 21:39 bin/packages/mips_24kc/base/libwolfssl4.7.0.66253b90_4.7.0-stable-3_mips_24kc.ipk
I should have written "is maybe an alternative to what @stangri is proposing". While this small change makes this issue go away, I don't know if it has any positive effect on the https-dns-proxy mem leak or the problem with Transmission.
wolfSSL README says regarding static key cipher suites: "They also lower your security by removing PFS." So yes, with wolfSSL you can only connect to PFS-enabled sites be default (the site in question is not PFS-enabled).
I've tried to look this up and couldn't find relevant information: is there a way to estimate the percentage of the sites which only support static key ciphers?
Also, regardless of the other issues with WolfSSL, maybe it's not a worst idea to send a PR to re-enable static key ciphers support in OpenWrt version of WolfSSL in the mean time. @micmac1 would you be willing to do that?
wolfSSL README says regarding static key cipher suites: "They also lower your security by removing PFS." So yes, with wolfSSL you can only connect to PFS-enabled sites be default (the site in question is not PFS-enabled).
I've tried to look this up and couldn't find relevant information: is there a way to estimate the percentage of the sites which only support static key ciphers?
There are probably some surveys available online.
Also, regardless of the other issues with WolfSSL, maybe it's not a worst idea to send a PR to re-enable static key ciphers support in OpenWrt version of WolfSSL in the mean time. Would you be willing to do that?
No, don't see myself getting into this. I have no opinion on this. I was just curious.
OpenWrt 21.02.1 Still the same, same trick use curl from 19.07.1
OpenWrt 21.02.2 Still the same, same trick use curl from 19.07.1
Tagging maintainer: @cotequeiroz.
I believe there were multiple changes necessary (on top of updating wolfssl) for a range of issues reported about same time as this, I'm not sure if the support for alt chains and static rsa has been enabled in master?
OpenWrt 21.02.3 Still the same, same trick use curl from 19.07.1
curl https://www.boe.es -v
Hi @Jeronimo17, can you please detail how you are installing curl from 19.07.01 ?
I understand you need thoses 3 files: curl_7.66.0-3_mipsel_24kc.ipk libcurl4_7.66.0-3_mipsel_24kc.ipk libnghttp2-14_1.41.0-1_mipsel_24kc.ipk
But have no clue how you installed them, I tried opkg install ... but it does not work
It already works and I don't do it but previously I think I deleted curl and libcurl.
opkg uninstall ...
Maintainer: @stangri @tripolar Environment: MediaTek MT7621 ver:1 eco:3, Newifi-D2, OpenWrt 21.02.0 r16279-5cc0535800
Description:
I think with 19.07 it didn't fail Thank you