[GH-ISSUE #3672] QUIC dialer fails with "doesn't contain any IP SANs" when connecting to relay hostname #7700

Open
opened 2026-08-05 01:14:07 -04:00 by saavagebueno · 0 comments
Owner

Originally created by @alindt on GitHub (Apr 14, 2025).
Original GitHub issue: https://github.com/netbirdio/netbird/issues/3672

Originally assigned to: @pappz on GitHub.

Describe the problem

When connecting to a relay server by hostname, the QUIC dialer fails with certificate validation errors while the WebSocket dialer works correctly. The QUIC dialer validates the certificate against the resolved IP address instead of the hostname.

To Reproduce

Steps to reproduce the behavior:

  1. Set up a self-hosted relay server with a Let's Encrypt certificate (or any certificate with DNS SANs only)
  2. Configure NetBird to use this relay server by hostname (not IP address)
  3. Attempt to connect to the relay
  4. Error in logs:
    failed to dial to Relay server via QUIC 'example.com:33080': CRYPTO_ERROR 0x12a (local): tls: failed to verify certificate: x509: cannot validate certificate for 192.0.2.10 because it doesn't contain any IP SANs

Expected behavior

The QUIC dialer should validate the certificate against the hostname used for connection, not the resolved IP address. This would allow successful connections with certificates that only have DNS SANs (like standard Let's Encrypt certificates).

Are you using NetBird Cloud?

Self-hosted NetBird control plane.

NetBird version

0.41.0

Is any other VPN software installed?

No.

Additional context

The issue is in relay/client/dialer/quic/quic.go where the TLS config doesn't set ServerName when connecting via hostname. The WebSocket dialer works properly because the HTTP client automatically sets the hostname for certificate validation.

Originally created by @alindt on GitHub (Apr 14, 2025). Original GitHub issue: https://github.com/netbirdio/netbird/issues/3672 Originally assigned to: @pappz on GitHub. **Describe the problem** When connecting to a relay server by hostname, the QUIC dialer fails with certificate validation errors while the WebSocket dialer works correctly. The QUIC dialer validates the certificate against the resolved IP address instead of the hostname. **To Reproduce** Steps to reproduce the behavior: 1. Set up a self-hosted relay server with a Let's Encrypt certificate (or any certificate with DNS SANs only) 2. Configure NetBird to use this relay server by hostname (not IP address) 3. Attempt to connect to the relay 4. Error in logs: `failed to dial to Relay server via QUIC 'example.com:33080': CRYPTO_ERROR 0x12a (local): tls: failed to verify certificate: x509: cannot validate certificate for 192.0.2.10 because it doesn't contain any IP SANs` **Expected behavior** The QUIC dialer should validate the certificate against the hostname used for connection, not the resolved IP address. This would allow successful connections with certificates that only have DNS SANs (like standard Let's Encrypt certificates). **Are you using NetBird Cloud?** Self-hosted NetBird control plane. **NetBird version** 0.41.0 **Is any other VPN software installed?** No. **Additional context** The issue is in `relay/client/dialer/quic/quic.go` where the TLS config doesn't set ServerName when connecting via hostname. The WebSocket dialer works properly because the HTTP client automatically sets the hostname for certificate validation.
saavagebueno added the triage-needed label 2026-08-05 01:14:07 -04:00
Sign in to join this conversation.
No Label triage-needed
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: DYNR/netbird#7700