wget TLS error from peer (alert code 40): handshake failure on TLS 1.2 and TLS 1.3 X25519 AES256-GCM
Hannasch, David Alexander
dahanna at sandia.gov
Mon Jan 10 22:33:29 UTC 2022
package: busybox
version: 1.35.0
When I execute busybox 'wget' it is unable to handshake with a TLS 1.3 X25519 AES256-GCM host.
I have not been able to build busybox from source, so I am using the busybox:1.35.0 container.
I have been using the following scripting:
test-busybox:
tags:
- docker
image: busybox:1.35.0
script:
- find / -name *libtls*
- find / -name *libretls*
- wget $TLS_13_URL
test-alpine:
tags:
- docker
image: alpine:3.15.0
script:
- find / -name *libtls* # /usr/lib/libtls.so.2.0.0
- find / -name *libretls*
- wget $TLS_13_URL
If you're not familiar with GitLab YAML, all that matters is the image name and the script. It's just loading busybox:1.35.0 and trying to wget.
Using Ubuntu, CentOS, or Alpine, wget works fine on this URL.
$ wget $TLS_13_URL
saving to 'index.html'
index.html 100% |********************************| 32211 0:00:00 ETA
'index.html' saved
Using busybox:1.35.0, wget fails.
$ wget $TLS_13_URL
wget: TLS error from peer (alert code 40): handshake failure
wget: error getting response: Connection reset by peer
(If it matters, 1.34.1 fails the same way.)
Unfortunately I do not know of a public-facing URL that supports only TLS 1.2 and 1.3, but I expect that wget will fail in the same way.
If desired, I have a great deal more information on the supported TLS below.
As mentioned, Ubuntu/CentOS/Alpine are all able to use wget just fine. Alpine is the most interesting, since Alpine actually uses BusyBox 1.34.1.
It looks like they rebuilt against a newer version of libtls.
https://gitlab.alpinelinux.org/alpine/aports/-/issues/11695
BusyBox doesn't appear (?) to be using libtls, or at least, I haven't found reference to it in the source, so I'm not sure whether a similar solution would work outside of Alpine.
Thank you,
David Hannasch
The promised details on the server are:
$ openssl s_client -connect $INTERNAL_HOST:443 -tls1_3
CONNECTED(00000003)
depth=2 C = US, ST = New Jersey, L = Jersey City, O = The USERTRUST Network, CN = USERTrust RSA Certification Authority
verify return:1
---
Certificate chain
...
No client certificate CA names sent
Peer signing digest: SHA256
Peer signature type: RSA-PSS
Server Temp Key: X25519, 253 bits
---
SSL handshake has read 6990 bytes and written 325 bytes
Verification: OK
---
New, TLSv1.3, Cipher is TLS_AES_256_GCM_SHA384
Server public key is 4096 bit
Secure Renegotiation IS NOT supported
No ALPN negotiated
Early data was not sent
Verify return code: 0 (ok)
---
DONE
$ openssl s_client -connect $INTERNAL_HOST:443 -tls1_2
CONNECTED(00000003)
depth=2 C = US, ST = New Jersey, L = Jersey City, O = The USERTRUST Network, CN = USERTrust RSA Certification Authority
verify return:1
---
No client certificate CA names sent
Peer signing digest: SHA256
Peer signature type: RSA-PSS
Server Temp Key: X25519, 253 bits
---
SSL handshake has read 6898 bytes and written 309 bytes
Verification: OK
---
New, TLSv1.2, Cipher is ECDHE-RSA-CHACHA20-POLY1305
Server public key is 4096 bit
Secure Renegotiation IS supported
No ALPN negotiated
SSL-Session:
Protocol : TLSv1.2
Cipher : ECDHE-RSA-CHACHA20-POLY1305
Verify return code: 0 (ok)
Extended master secret: yes
---
DONE
$ openssl s_client -connect $INTERNAL_HOST:443 -tls1_1 || echo "TLS 1.1 is not supported."
CONNECTED(00000003)
---
no peer certificate available
---
No client certificate CA names sent
---
SSL handshake has read 7 bytes and written 134 bytes
Verification: OK
---
New, (NONE), Cipher is (NONE)
Secure Renegotiation IS NOT supported
No ALPN negotiated
SSL-Session:
Protocol : TLSv1.1
Cipher : 0000
Session-ID:
Session-ID-ctx:
Master-Key:
PSK identity: None
PSK identity hint: None
SRP username: None
Start Time: 1641851758
Timeout : 7200 (sec)
Verify return code: 0 (ok)
Extended master secret: no
---
TLS 1.1 is not supported.
$ nmap --script ssl-enum-ciphers -p 443 $INTERNAL_HOST
Starting Nmap 7.92 ( https://nmap.org ) at 2022-01-10 21:55 UTC
Host is up (0.0011s latency).
PORT STATE SERVICE
443/tcp open https
| ssl-enum-ciphers:
| TLSv1.2:
| ciphers:
| TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256 (ecdh_x25519) - A
| TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (ecdh_x25519) - A
| compressors:
| NULL
| cipher preference: server
| warnings:
| Key exchange (ecdh_x25519) of lower strength than certificate key
| TLSv1.3:
| ciphers:
| TLS_AKE_WITH_AES_256_GCM_SHA384 (ecdh_x25519) - A
| TLS_AKE_WITH_CHACHA20_POLY1305_SHA256 (ecdh_x25519) - A
| TLS_AKE_WITH_AES_128_GCM_SHA256 (ecdh_x25519) - A
| cipher preference: server
|_ least strength: A
Nmap done: 1 IP address (1 host up) scanned in 0.50 seconds
If there are some TLS's that BusyBox does not support, is that documented anywhere?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/busybox/attachments/20220110/1d1898a4/attachment-0001.html>
More information about the busybox
mailing list