Versa SASE Client on macOS fails to register with "A TLS error caused the secure connection to fail" when the captive portal uses a CA certificate


Summary

Mac users cannot register the Versa SASE Client to the portal, while Windows users on the same portal register normally. macOS rejects the certificate the portal presents because it does not meet Apple's requirements for trusted TLS server certificates.

When the captive portal is configured with a CA certificate (ssl-ca-certificate), the gateway does not present a certificate you issued. It generates the portal certificate itself and signs it with the CA. That generated certificate has no Extended Key Usage for server authentication and can carry a validity longer than 825 days. macOS rejects a certificate for either reason. Configuring the captive portal with a server certificate that meets Apple's requirements resolves the issue.

Applies to

Symptoms

Registration fails on the Mac with the following message:

Failed to Register!
A TLS error caused the secure connection to fail.

Macs that already hold a registration also fail to connect, because every connection attempt starts with the same HTTPS call to the portal. The client log (versa_Client.log) shows the call failing before any HTTP response is received:

Registration portal discover failed (registration) — A TLS error caused the secure connection to fail.
Registration portal discover unsuccessful (registration) — HTTP -1
Registration pre-register request failed — A TLS error caused the secure connection to fail.
VPN State Transition: Started → Failed | Reason: Gateway Discover API Unreachable

Reinstalling the client, updating macOS and reinstalling the CA certificate on the Mac do not help.

Opening the portal discover URL in Safari on the same Mac shows the CA as trusted but rejects the portal certificate:

"<portal FQDN>" certificate is not standards compliant

Checking the portal certificate with macOS trust evaluation from Terminal also fails:

security verify-cert -c /tmp/portal.pem -p ssl -s <portal FQDN>
Cert Verify Result: CSSMERR_TP_CERT_SUSPENDED

Google Chrome may open the same URL without a warning, because Chrome verifies certificates with its own verifier and does not apply these Apple rules.

Cause

Since macOS 10.15, Apple applies additional requirements to TLS server certificates. These apply to certificates from private CAs as well as public CAs. The requirements apply to the server (leaf) certificate the portal presents. CA certificates in the chain are not limited in validity.

RequirementServer (leaf) certificateCA certificate
Validity825 days or less (certificates issued after July 1, 2019)No limit
Extended Key UsageMust include serverAuth (TLS Web Server Authentication)Not required
HostnameThe portal FQDN must be in the Subject Alternative Name. The Common Name is not used for name matching.Not applicable
Key and signatureRSA 2048 bits or larger, SHA-2 signatureRSA 2048 bits or larger, SHA-2 signature

Each requirement is enforced on its own. A certificate that is too long-lived fails even with serverAuth, and a certificate without serverAuth fails even with a short validity.

The captive portal can obtain its HTTPS certificate in two ways:

​Server certificate modeCA certificate mode
Configurationservice-endpoints <VR> server-certificate <certificate>ssl-ca-certificate <CA certificate>
Certificate presentedThe certificate you issued and loadedA certificate the gateway generates for the requested hostname and signs with the CA
Contents controlled byYou (validity, Extended Key Usage, SAN)The gateway software
Typical useA fixed portal FQDN, such as the SASE registration portalCases where the hostname is not known in advance

In CA certificate mode the generated certificate has a subject with only the Common Name and carries Basic Constraints, Subject Key Identifier and Subject Alternative Name, but no Extended Key Usage. Its validity can be taken from the CA certificate, so a CA valid for five years produces a portal certificate valid for five years. A generated certificate looks like this:

subject=CN = portal.example.com
issuer=CN = Example-Enterprise-CA, O = Example, OU = VPN
notBefore=Aug  7 15:04:37 2024 GMT
notAfter=Aug  6 15:04:37 2029 GMT
X509v3 Basic Constraints: critical
    CA:FALSE
X509v3 Subject Alternative Name:
    DNS:portal.example.com
(no X509v3 Extended Key Usage)

macOS rejects this certificate, so the Mac client fails at the first HTTPS call to the portal. Changing the certificate on the IPsec VPN profile does not help. That certificate is used later, to build the tunnel, and does not affect the portal's HTTPS certificate.

Resolution

Configure the captive portal with a server certificate for the portal FQDN that meets Apple's requirements. The CA certificate installed on the Macs does not need to change.

  1. Confirm the captive portal mode. If ssl-ca-certificate is present, the portal is in CA certificate mode.
    show configuration orgs org-services <org> security captive-portal | display set
  2. Prepare a server certificate for the portal FQDN, issued by the CA the Macs already trust. Check that it meets the requirements:
    openssl x509 -in <certificate>.crt -noout -dates -ext extendedKeyUsage,subjectAltName
    The output must show TLS Web Server Authentication under Extended Key Usage, DNS:<portal FQDN> under Subject Alternative Name, and a validity of 825 days or less. If a new certificate is needed, issue it with these extensions:
    basicConstraints = critical, CA:FALSE
    keyUsage = critical, digitalSignature, keyEncipherment
    extendedKeyUsage = serverAuth
    subjectAltName = DNS:<portal FQDN>
  3. Load the certificate and its private key into the organization that holds the captive portal configuration.
  4. Remove the CA certificate from the captive portal and set the server certificate on the existing service endpoint:


    delete orgs org-services <org> security captive-portal ssl-ca-certificate
    set orgs org-services <org> security captive-portal service-endpoints <WAN-VR> server-certificate <certificate>
    commit
    The service endpoint must also have ip-addresses set to the WAN interface IP. When the gateway is behind NAT, for example in a public cloud, use the private IP assigned on the WAN interface, not the public IP.
  5. Verify from a Mac. Open the discover URL in Safari. It should load without a certificate warning and show the new certificate:
    https://<portal FQDN>/secure-access/services/gateway?action=discover&ent_name=<enterprise name>
    Then register the SASE Client again.

When the server certificate is renewed, issue the new certificate with the same extensions and a validity of 825 days or less.

Additional information