SIP TLS certificate name mismatch
A TLS client does not only ask whether a certificate is genuine, it also asks whether it belongs to the server it meant to reach. It takes the name it connected to, such as the hostname in a trunk's settings, and looks for it in the certificate's list of subject alternative names (SANs). If the name is missing the client stops, because a valid certificate for some other host proves nothing about this one.
On SIP this tends to surface after a change: a new hostname for the server, a trunk moved to another FQDN, or a peer switched from an IP address to a name. Lenient peers that skip the check keep working while strict ones such as cloud contact centers and Microsoft Teams refuse to connect, so the same server can look healthy from one side and broken from the other.
Error messages you may see
hostname mismatchx509: certificate is valid for sbc1.example.com, not sbc2.example.comx509: certificate relies on legacy Common Name field, use SANs insteadx509: cannot validate certificate for 203.0.113.10 because it doesn't contain any IP SANs
Common causes
- The certificate was issued for an older hostname, or for the company's web domain, rather than the name peers use for SIP.
- The name appears only in the common name (CN), which current clients ignore whenever the certificate has SANs.
- A wildcard is stretched too far: *.example.com covers sbc.example.com, but not edge.sbc.example.com and not example.com itself.
- The peer connects by IP address and the certificate lists only DNS names, which is normal for publicly issued certificates.
- A server that holds several certificates picks one by the SNI name in the ClientHello, and the peer sends no SNI or a different name.
How to fix it
- List the names the certificate really covers by reading the SAN extension of the certificate the server sends.
- Reissue the certificate with every FQDN that peers dial in its SAN list, including the names used for failover.
- Configure peers to connect by hostname rather than by IP address, so the name they check is one a CA can include.
- On a server with several certificates, map each SNI name to the right one and choose a sensible default for clients that send none.
Certificate names when DNS SRV is used
When a peer reaches your server through an SRV record, the name it must find in the certificate is the SIP domain it was given, not the target the record points to. RFC 5922 sets that rule: a client told to call example.com that ends up at sbc1.example.net looks for example.com and sends it as the SNI name.
Plenty of carriers still issue one certificate per node that names only the target. PingVo monitoring accepts either name, and the free check marks a certificate that covers the target alone as SRV target only. To satisfy strict peers, add the SIP domain to the certificate's SAN list, or publish the target itself as the name peers are configured with. More in SIP DNS and TLS.
Platform notes
- Microsoft Teams Direct Routing: The SBC's FQDN must be the certificate's CN or one of its SANs. Wildcards follow RFC 2818 and match one level only.
- FreeSWITCH: FreeSWITCH checks the subject of a peer's certificate only when tls-verify-policy uses a subjects_ value, and the default, none, verifies no peer certificates.
How the free check shows it
The Name row fails when the host you typed is not in the certificate, and shows the names it does cover. If you typed an IP address it only warns, since peers normally connect by name. On a TLS Route, PingVo compares the certificate with the Route's gateway host on every fresh connection, shows any mismatch on Route detail and can alert you about it.
Questions
Is the common name (CN) still checked?
Less and less. The current rules for names in TLS, RFC 9525, no longer use it, and clients built on Go already reject a certificate whose name is only in the CN. Put every name in the SAN list.
Can a SIP TLS certificate cover an IP address?
Yes, as an IP SAN, but public CAs rarely issue them for SIP servers. Peers that dial an IP address therefore fail the name check against almost any public certificate, so trunks are best configured by FQDN.
Should a certificate list both the SIP domain and the server's hostname?
It is the safest choice. Peers that follow RFC 5922 look for the domain, many others look for the host they connected to, and one certificate carrying both names passes with each kind.