Azure Front Door will sometimes only deliver a certificate after repeated requests

Martin Haug 36 Reputation points
2023-11-08T22:05:34.09+00:00

I have configured Azure Front Door to deliver HTTPS-encrypted traffic on my Apex Domain.

However, both I and some of my customers sometimes observe that the server will not offer a TLS certificate upon establishing the connection. For a customer, this can mean that they are not able to use my website at all. Instead, the pageload will fail with PR_END_OF_FILE_ERROR in Firefox or other, similar error codes in other browsers.

This can be verified by running openssl s_client -port 443 typst.app where typst.app is my Apex Domain, for example in an Azure Cloud Shell. If the request fails, the output looks like this:

CONNECTED(00000003)
write:errno=104
---
no peer certificate available
---
No client certificate CA names sent
---
SSL handshake has read 0 bytes and written 303 bytes
Verification: OK
---
New, (NONE), Cipher is (NONE)
Secure Renegotiation IS NOT supported
No ALPN negotiated
Early data was not sent
Verify return code: 0 (ok)
---

When repeatedly calling the command after receiving this error, the server will start delivering a certificate as expected:

CONNECTED(00000006)
depth=2 C = US, O = DigiCert Inc, OU = www.digicert.com, CN = DigiCert Global Root CA
verify return:1
depth=1 C = US, O = "DigiCert, Inc.", CN = GeoTrust Global TLS RSA4096 SHA256 2022 CA1
verify return:1
depth=0 CN = typst.app
verify return:1
---
Certificate chain
 0 s:CN = typst.app
   i:C = US, O = "DigiCert, Inc.", CN = GeoTrust Global TLS RSA4096 SHA256 2022 CA1
   a:PKEY: rsaEncryption, 2048 (bit); sigalg: RSA-SHA256
   v:NotBefore: Jul  7 00:00:00 2023 GMT; NotAfter: Jan  7 23:59:59 2024 GMT
 1 s:C = US, O = "DigiCert, Inc.", CN = GeoTrust Global TLS RSA4096 SHA256 2022 CA1
   i:C = US, O = DigiCert Inc, OU = www.digicert.com, CN = DigiCert Global Root CA
   a:PKEY: rsaEncryption, 4096 (bit); sigalg: RSA-SHA256
   v:NotBefore: May  4 00:00:00 2022 GMT; NotAfter: Nov  9 23:59:59 2031 GMT
 2 s:C = US, O = DigiCert Inc, OU = www.digicert.com, CN = DigiCert Global Root CA
   i:C = US, O = DigiCert Inc, OU = www.digicert.com, CN = DigiCert Global Root CA
   a:PKEY: rsaEncryption, 2048 (bit); sigalg: RSA-SHA1
   v:NotBefore: Nov 10 00:00:00 2006 GMT; NotAfter: Nov 10 00:00:00 2031 GMT
---
Server certificate
-----BEGIN CERTIFICATE-----
MIIHfzCCBWegAwIBAgIQBcpPD/igtIC6+P4kvvfXzTANBgkqhkiG9w0BAQsFADBc
MQswCQYDVQQGEwJVUzEXMBUGA1UEChMORGlnaUNlcnQsIEluYy4xNDAyBgNVBAMT
(remaining certificate omitted)
-----END CERTIFICATE-----
subject=CN = typst.app
issuer=C = US, O = "DigiCert, Inc.", CN = GeoTrust Global TLS RSA4096 SHA256 2022 CA1
---
No client certificate CA names sent
Peer signing digest: SHA256
Peer signature type: RSA-PSS
Server Temp Key: ECDH, prime256v1, 256 bits
---
SSL handshake has read 4878 bytes and written 437 bytes
Verification: OK
---
New, TLSv1.2, Cipher is ECDHE-RSA-AES256-GCM-SHA384
Server public key is 2048 bit
Secure Renegotiation IS supported
Compression: NONE
Expansion: NONE
No ALPN negotiated
SSL-Session:
    Protocol  : TLSv1.2
    Cipher    : ECDHE-RSA-AES256-GCM-SHA384
    Session-ID: (redacted)
    Session-ID-ctx: 
    Master-Key: (redacted)
    PSK identity: None
    PSK identity hint: None
    SRP username: None
    Start Time: 1699480538
    Timeout   : 7200 (sec)
    Verify return code: 0 (ok)
    Extended master secret: yes
---

How can I address this issue so that the certificate is always delivered?

Azure Front Door
Azure Front Door
An Azure service that provides a cloud content delivery network with threat protection.
584 questions
{count} votes