2023-06-15
we started seeing an increase in SSL handshake failures in our http client request logs
Both PHP Guzzle (cURL) and Nodejs Axios applications reports these logs.
We run almost all versions of PHP 8.0.x, 8.1.x and even some 8.2.x, they all report these logs at random, nodejs too.
I suspected dropped network packets, so I had a look at our network interface metrics, but
to my surprise I didn’t find any noticable dropped packets on any network interface on any production nodes, firewalls or switches. We have had dropped packet issues in the past so I knew to look
I then compiled a little application that calls openssl -connect <example.com> -tls1_2/-tls1_3
every 100ms and deployed it across a variety locations (our own servers, digital ocean droplets and google vm’s), some located in London, others in Frankfurt and some in Denmark
I directed these applications to several of our cloudflared proxied zones, both enterprise and free.
Some origin servers gets traffic from cloudflare the “old” way, but most gets traffic via cloudflared tunnel
About 0.1% of the times i get this from openssl, randomly spread across deploy location and origin targets.
CONNECTED(00000003)
48DBB9BB7A7F0000:error:0A000410:SSL routines:ssl3_read_bytes:sslv3 alert handshake failure:ssl/record/rec_layer_s3.c:1586:SSL alert number 40
---
no peer certificate available
---
No client certificate CA names sent
---
SSL handshake has read 7 bytes and written 212 bytes
Verification: OK
---
New, (NONE), Cipher is (NONE)
Secure Renegotiation IS NOT supported
No ALPN negotiated
SSL-Session:
Protocol : TLSv1.2
Cipher : 0000
Session-ID:
Session-ID-ctx:
Master-Key:
PSK identity: None
PSK identity hint: None
SRP username: None
Start Time: 1689080480
Timeout : 7200 (sec)
Verify return code: 0 (ok)
Extended master secret: no
---
or for TLS 1.3
CONNECTED(00000003)
480B4F5C237F0000:error:0A000410:SSL routines:ssl3_read_bytes:sslv3 alert handshake failure:ssl/record/rec_layer_s3.c:1586:SSL alert number 40
---
no peer certificate available
---
No client certificate CA names sent
---
SSL handshake has read 7 bytes and written 249 bytes
Verification: OK
---
New, (NONE), Cipher is (NONE)
This TLS version forbids renegotiation.
No ALPN negotiated
Early data was not sent
Verify return code: 0 (ok)
---
I’ve opened a cloudflare support ticket, and is in the process of punching through the initial first-level support questions
In the meantime I could use some help figuring out what is going on here.
I’m able to setup just about any test, if someone has any good idea how to get more debug information, and we have just about all the metrics one could wish for.
Thanks in advance
Mads