Skip to content

Authentication fails with invalid TLS certificate error on self-hosted Coder deployment (macOS) #285

Open

Description

@SaadBazaz
Image

Coder Desktop version: 0.8.4
Deployment: Self-hosted Coder on Linux
Platform: macOS

Description

I'm unable to authenticate with my self-hosted Coder deployment using Coder Desktop for macOS.

The application displays the following error:

Could not authenticate with Coder deployment:
The certificate for this server is invalid. You might be connecting to a server that is pretending to be “[my Coder deployment hostname]” which could put your confidential information at risk.

The deployment uses a publicly issued Let's Encrypt certificate. I've investigated the TLS configuration on both the server and macOS, but haven't been able to identify the cause.

Diagnostics

1. OpenSSL certificate verification

Running openssl s_client against the deployment:

openssl s_client \
  -connect YOUR_CODER_HOST:443 \
  -servername YOUR_CODER_HOST \
  -showcerts \
  -verify_return_error </dev/null

OpenSSL successfully verifies the certificate chain:

Verify return code: 0 (ok)

The server presents three certificates.

2. Certificate details

  • Subject: My Coder deployment hostname
  • Issuer: Let's Encrypt YR2
  • Validity: November 5, 2026 – February 3, 2027
  • Key: RSA 4096-bit
  • Signature: SHA-256 with RSA

3. macOS Keychain

I imported the leaf certificate into the System Keychain and explicitly set its trust policy to Always Trust.

This did not resolve the issue.

4. macOS certificate verification

Running:

security verify-cert -v https://YOUR_CODER_HOST

Returns:

...certificate verification successful.

The trust evaluation reports:

TrustResultValue = 1

It also reports:

Certificate Transparency (CT) status: not verified
Unable to find at least 2 signed certificate timestamps (SCTs) from approved logs

5. Application logs

Coder Desktop's macOS unified logs show normal VPN system extension initialization and Mutagen daemon startup/shutdown. However, the captured logs did not contain the actual authentication failure or a corresponding TLS error.

Timestamp                       Thread     Type        Activity             PID    TTL  
2026-11-06 19:03:51.610937+0500 0x3d06b8   Info        0x0                  32942  0    com.coder.Coder-Desktop.Helper: [com.coder.Coder-Desktop:system-wake-observer] system woke from sleep
2026-11-06 19:08:03.760032+0500 0x3d07a6   Info        0x0                  32991  0    Coder Desktop: (VPNLib) [com.coder.Coder-Desktop:mutagen] stopping mutagen daemon
2026-11-06 19:08:03.762378+0500 0x3d07a6   Info        0x0                  32991  0    Coder Desktop: (VPNLib) [com.coder.Coder-Desktop:mutagen] mutagen daemon state set: Stopped
2026-11-06 19:08:18.362918+0500 0x3dab47   Info        0x0                  47665  0    Coder Desktop: [com.coder.Coder-Desktop:vpn-installer] SystemExtensionDelegate initialized
2026-11-06 19:08:18.362919+0500 0x3dab47   Info        0x0                  47665  0    Coder Desktop: [com.coder.Coder-Desktop:vpn-installer] activating SystemExtension
2026-11-06 19:08:18.363801+0500 0x3dab47   Info        0x0                  47665  0    Coder Desktop: [com.coder.Coder-Desktop:vpn-installer] submitted SystemExtension request with bundleID: <private>
2026-11-06 19:08:18.560624+0500 0x3dab47   Info        0x0                  47665  0    Coder Desktop: (VPNLib) [com.coder.Coder-Desktop:mutagen] Successfully connected to mutagen daemon, socket: /Users/[REDACTED_USERNAME]/Library/Application Support/Coder Desktop/Mutagen/daemon/daemon.sock
2026-11-06 19:08:18.571456+0500 0x3dab47   Info        0x0                  47665  0    Coder Desktop: (VPNLib) [com.coder.Coder-Desktop:mutagen] stopping mutagen daemon
2026-11-06 19:08:18.571478+0500 0x3dab47   Info        0x0                  47665  0    Coder Desktop: (VPNLib) [com.coder.Coder-Desktop:mutagen] mutagen daemon state set: Stopped
2026-11-06 19:08:18.577621+0500 0x3dab47   Info        0x0                  47665  0    Coder Desktop: (VPNLib) [com.coder.Coder-Desktop:mutagen] starting mutagen daemon
2026-11-06 19:08:18.579644+0500 0x3dab47   Info        0x0                  47665  0    Coder Desktop: (VPNLib) [com.coder.Coder-Desktop:mutagen] setting mutagen data directory: /Users/[REDACTED_USERNAME]/Library/Application Support/Coder Desktop/Mutagen
2026-11-06 19:08:18.585370+0500 0x3dab47   Info        0x0                  47665  0    Coder Desktop: [com.coder.Coder-Desktop:vpn-installer] SystemExtension installed
2026-11-06 19:08:18.585440+0500 0x3dab47   Info        0x0                  47665  0    Coder Desktop: [com.coder.Coder-Desktop:vpn] system extension state: NE SystemExtension is installed
2026-11-06 19:08:18.665866+0500 0x3dab47   Info        0x0                  47665  0    Coder Desktop: (VPNLib) [com.coder.Coder-Desktop:mutagen] 2026-11-06 19:08:18.661966 [I] [forward] Looking for existing sessions
2026-11-06 19:08:18.666116+0500 0x3dab47   Info        0x0                  47665  0    Coder Desktop: (VPNLib) [com.coder.Coder-Desktop:mutagen] 2026-11-06 19:08:18.662276 [I] [forward] Session manager initialized
2026-11-06 19:08:18.666216+0500 0x3dab47   Info        0x0                  47665  0    Coder Desktop: (VPNLib) [com.coder.Coder-Desktop:mutagen] 2026-11-06 19:08:18.662297 [I] [sync] Looking for existing sessions
2026-11-06 19:08:18.666308+0500 0x3dab47   Info        0x0                  47665  0    Coder Desktop: (VPNLib) [com.coder.Coder-Desktop:mutagen] 2026-11-06 19:08:18.662343 [I] [sync] Session manager initialized
2026-11-06 19:08:19.218089+0500 0x3dab47   Info        0x0                  47665  0    Coder Desktop: (VPNLib) [com.coder.Coder-Desktop:mutagen] mutagen daemon state set: Running
2026-11-06 19:08:19.218663+0500 0x3dab47   Info        0x0                  47665  0    Coder Desktop: (VPNLib) [com.coder.Coder-Desktop:mutagen] mutagen daemon started, pid:
 47702
2026-11-06 19:08:19.222146+0500 0x3dab47   Info        0x0                  47665  0    Coder Desktop: (VPNLib) [com.coder.Coder-Desktop:mutagen] No sync sessions found on startup, stopping daemon
2026-11-06 19:08:19.223140+0500 0x3dab47   Info        0x0                  47665  0    Coder Desktop: (VPNLib) [com.coder.Coder-Desktop:mutagen] stopping mutagen daemon
2026-11-06 19:08:19.223186+0500 0x3dab47   Info        0x0                  47665  0    Coder Desktop: (VPNLib) [com.coder.Coder-Desktop:mutagen] mutagen daemon state set: Stopped
2026-11-06 19:08:19.225567+0500 0x3dab47   Info        0x0                  47665  0    Coder Desktop: (VPNLib) [com.coder.Coder-Desktop:mutagen] 2026-11-06 19:08:19.220353 [I] Daemon termination requested
2026-11-06 19:08:19.225627+0500 0x3dab47   Info        0x0                  47665  0    Coder Desktop: (VPNLib) [com.coder.Coder-Desktop:mutagen] mutagen daemon stopped
2026-11-06 19:08:19.225743+0500 0x3dab47   Info        0x0                  47665  0    Coder Desktop: (VPNLib) [com.coder.Coder-Desktop:mutagen] 2026-11-06 19:08:19.220786 [I] [sync] Shutting down
2026-11-06 19:08:19.225932+0500 0x3dab47   Info        0x0                  47665  0    Coder Desktop: (VPNLib) [com.coder.Coder-Desktop:mutagen] Daemon stopped and gRPC connection closed
2026-11-06 19:08:19.225971+0500 0x3dab47   Info        0x0                  47665  0    Coder Desktop: (VPNLib) [com.coder.Coder-Desktop:mutagen] 2026-11-06 19:08:19.220811 [I] [forward] Shutting down
2026-11-06 19:08:19.226073+0500 0x3dab47   Info        0x0                  47665  0    Coder Desktop: (VPNLib) [com.coder.Coder-Desktop:mutagen] standard error stream closed

Expected behavior

Coder Desktop should authenticate successfully with a self-hosted Coder deployment using a valid, publicly trusted Let's Encrypt certificate.

Actual behavior

Authentication fails with a certificate-invalid warning, even though OpenSSL successfully verifies the server certificate and macOS certificate verification succeeds with the manually trusted leaf certificate.


I'm happy to provide additional diagnostics, including the complete certificate chain, macOS version, server version, and application logs.

Activity

  1. linear-code commented on Nov 6, 2026

    @linear-code
  2. matifali commented on Nov 9, 2026

    @matifali

    Thanks for the detailed report! Coder Desktop uses the standard macOS networking stack with no custom certificate checks, so this error comes from macOS itself.

    The key line is the CT failure in your security verify-cert output: macOS rejects publicly trusted certificates that don't meet Apple's Certificate Transparency policy, and OpenSSL doesn't run that check. TrustResultValue = 1 only means the cert passed because you manually set it to Always Trust.

    Likely causes: your Mac's list of approved CT logs is out of date, or your server is sending the old Root YR cross-signed certificate that Let's Encrypt revoked in May 2026.

    Could you share:

    1. Your macOS version, and whether updates are current
    2. Whether https://YOUR_CODER_HOST loads in Safari on the same Mac
    3. The SSLMate CT Policy Analyzer result for your hostname
    4. The output of:
      openssl s_client -connect YOUR_CODER_HOST:443 -servername YOUR_CODER_HOST -showcerts </dev/null 2>/dev/null \
        | awk '/BEGIN CERT/{n++} {print > ("cert" n ".pem")}'
      openssl x509 -in cert3.pem -noout -subject -issuer -dates
      
      notBefore should be May 13 2026; an earlier date means the revoked cert, so redeploy the full chain from your ACME client.
    5. security verify-cert -v https://YOUR_CODER_HOST after removing the Always Trust setting from the leaf certificate
  3. SaadBazaz commented on Nov 11, 2026

    @SaadBazaz
    Author

    @matifali -

    Could you share:

    1. Your macOS version, and whether updates are current

    macOS Sequoia, 15.7.7
    Idk if updates are current tbh

    1. Whether https://YOUR_CODER_HOST loads in Safari on the same Mac

    Loads fine. No issues.

    1. The SSLMate CT Policy Analyzer result for your hostname

    It shows:Your site is compliant with Chrome's Certificate Transparency policy.

    Your site is compliant with Apple's Certificate Transparency policy.
    Show SCTs
    Mechanism Log Signature Log Status Timestamp
    Apple Chrome
    Embedded Google Xenon 2027h1 Authentic Usable Usable 2026-11-05T10:52:20.34Z
    Embedded IPng Gouda 2027h1 Authentic Usable Usable 2026-11-05T10:52:21.742Z

    1. The output of:> openssl s_client -connect YOUR_CODER_HOST:443 -servername YOUR_CODER_HOST -showcerts </dev/null 2>/dev/null > | awk '/BEGIN CERT/{n++} {print > ("cert" n ".pem")}'
      openssl x509 -in cert3.pem -noout -subject -issuer -dates

    subject=C = US, O = ISRG, CN = Root YR
    issuer=C = US, O = Internet Security Research Group, CN = ISRG Root X1
    notBefore=May 13 00:00:00 2026 GMT
    notAfter=Sep 2 23:59:59 2032 GMT

    notBefore should be May 13 2026; an earlier date means the revoked cert, so redeploy the full chain from your ACME client.
    5. security verify-cert -v https://YOUR_CODER_HOST after removing the Always Trust setting from the leaf certificate

    connection to coder... port 443 (tcp) opened
    connection to coder... port 443 (tcp) closed
    ...certificate verification successful.

    Certificate chain
    0: coder....
    <cert(0x14201c200) s: coder.... i: YR2>
    1: YR2
    <cert(0x14201cc00) s: YR2 i: Root YR>
    2: Root YR
    <cert(0x14201d400) s: Root YR i: ISRG Root X1>
    3: ISRG Root X1
    <cert(0x14201de00) s: ISRG Root X1 i: ISRG Root X1>

    No extended validation result found
    Certificate Transparency (CT) status: verified

    Trust evaluation results
    {
    TrustCertificateTransparency = 1;
    TrustEvaluationDate = "2026-11-11 10:39:30 +0000";
    TrustResultDetails = (
    {
    },
    {
    },
    {
    },
    {
    }
    );
    TrustResultValue = 4;
    }


    Btw I'm not the only one facing this issue, my coworker is too. He's also on Mac. Other coworkers on Windows, face no issues at all.

  4. matifali commented on Nov 11, 2026

    @matifali

    Thanks, that rules out CT and the chain: macOS trusts the cert (TrustResultValue = 4), so Coder Desktop is likely seeing a different connection than Safari.

    Could you share:

    1. Does the hostname in the Coder Desktop error exactly match what you load in Safari (including port)?
    2. Are you or your coworker running any security, proxy, or VPN software (e.g. Zscaler, Netskope, Little Snitch, corporate VPN)?
    3. The output of nscurl --ats-diagnostics --verbose https://YOUR_CODER_HOST/api/v2/buildinfo
    4. Logs captured while you retry sign-in:
      log stream --level debug --predicate 'process == "trustd" OR process == "Coder Desktop"' > coder-tls.log
      Stop it with Ctrl+C after the error appears, then attach coder-tls.log (redact your hostname if needed).
    5. You can send them to me at atif@coder[dot]com
  5. SaadBazaz commented on Nov 12, 2026

    @SaadBazaz
    Author

    @matifali - Emailed you.

  6. matifali commented on Nov 12, 2026

    @matifali

    @SaadBazaz Thanks for the logs, they show the cause: your server sends a different certificate over HTTP/3 (QUIC) than over regular HTTPS.

    Coder Desktop picks up the server's Alt-Svc header and connects over HTTP/3, and on that connection Traefik presents its self-signed TRAEFIK DEFAULT CERT instead of your Let's Encrypt cert, so macOS rejects it (-9813/-1202). nscurl shows the same thing: the first request (TCP) passes, then every request after it gets the Traefik default cert. openssl and security verify-cert only use TCP, which is why they passed.

    To fix it, either make Traefik's HTTP/3 entrypoint serve your Let's Encrypt cert (for example, set it as Traefik's default certificate, and make sure UDP 443 reaches the same Traefik instance), or turn off HTTP/3. You can check with curl --http3-only -v https://YOUR_CODER_HOST.

  7. SaadBazaz commented on Nov 12, 2026

    @SaadBazaz
    Author
  8. matifali commented on Nov 12, 2026

    @matifali

    Thanks for digging into this with us! The logs show your server presents Traefik's self-signed default certificate over HTTP/3, which macOS rightly rejects. There's no supported way to turn off HTTP/3 on macOS, so this needs a Traefik change. Either option from the Traefik docs should help:

    1. Serve your Let's Encrypt certificate as Traefik's default: ACME Default Certificate
    2. Disable HTTP/3 on your :443 entrypoint: EntryPoints, HTTP3

    You can check with curl --http3-only -v https://YOUR_CODER_HOST; it should no longer return TRAEFIK DEFAULT CERT. Let us know if Coder Desktop still fails after that!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions