SSL_ERROR_BAD_CERT_DOMAIN错误,requested domain name does not match the server‘s certificate.

这篇文章资料来自于网络,对部分知识整理,这里只是记录一下,仅供参考。

0、一般错误代码

问题代码问题描述解决方法
NET::ERR_CERT_DATE_INVALID网站的ssl证书有效期过期导致的重新申请新的SSL证书
NET::ERR_CERT_COMMON_NAME_INVALID访问的域名和证书绑定的域名不一致导致请检查访问的域名或者证书绑定的域名是否相同
NET::ERR_CERT_AUTHORITY_INVALID使用了自签证书或者已经被吊销的根证书导致请在合法的CA申请SSL证书
NET::ERR_CERT_REVOKED证书文件已经被吊销导致请重新申请SSL证书
NET::ERR_SSL_PINNED_KEY_NOT_IN_CERT_CHAIN服务器提供的证书与内置预期证书不匹配网站可能遭到劫持伪造了证书,请立即停止访问该网站
NET::ERR_CERT_WEAK_SIGNATURE_ALGORITHM网站使用已经过期的SHA1算法的中间证书请联系CA更换最新算法的证书
SEC_ERROR_EXPIRED_CERTIFICATE网站的SSL证书有效期过期导致的申请新的SSL证书
SSL_ERROR_BAD_CERT_DOMAIN使用了自签证书或者已经被吊销的根证书导致,请在合法的CA申请SSL证书请检查访问的域名或者证书绑定的域名是否相同
SEC_ERROR_UNKNOWN_ISSUER使用了自签证书或者已经被吊销的根证书导致,请在合法的CA申请SSL证书请在合法的CA申请SSL证书
SEC_ERROR_REVOKED_CERTIFICATE证书文件已经被吊销导致请重新申请SSL证书
MOZILLA_PKIX_ERROR_KEY_PINNING_FAILURE服务器提供的证书与内置预期证书不匹配网站可能遭到劫持伪造了证书,请立即停止访问该网站
SSL_ERROR_NO_CYPHER_OVERLAP网站使用了不受支持的协议配置证书的加密套件和加密算法不浏览器支持可以参考这个修复指南

1、SSL_ERROR_BAD_CERT_DOMAIN报错

curl -iv https://ha.test.com/check  报错:

curl -iv https://ha.test.com/check
* About to connect() to ha.test.com port 443 (#0)
*   Trying 11.11.11.198...
* Connected to ha.test.com (11.11.11.198) port 443 (#0)
* Initializing NSS with certpath: sql:/etc/pki/nssdb
*   CAfile: /etc/pki/tls/certs/ca-bundle.crt
  CApath: none
* Server certificate:
*       subject: CN=ha-test.com,O=haha Corporation,ST=haha,C=CN
*       start date: Apr 21 00:00:00 2024 GMT
*       expire date: May 21 20:59:59 2025 GMT
*       common name: ha-test.com
*       issuer: CN=Secure Server CA,O=HA Limited,L=HA,ST=HA Manchester,C=GB
* NSS error -12276 (SSL_ERROR_BAD_CERT_DOMAIN)
* Unable to communicate securely with peer: requested domain name does not match the server's certificate.
* Closing connection 0
curl: (51) Unable to communicate securely with peer: requested domain name does not match the server's certificate.

2、原因

The SSL_ERROR_BAD_CERT_DOMAIN error occurs when a web browser or client attempts to establish a secure connection (using SSL/TLS) to a server, but the domain name in the URL does not match the domain name on the SSL certificate presented by the server. This mismatch can happen for several reasons:

  1. Incorrect Domain Name: The SSL certificate is issued for a specific domain (e.g., example.com), but the user is trying to access a different domain (e.g., anotherexample.com).
  2. Subdomain Issues: The certificate may be valid for a specific domain but not for its subdomains. For example, a certificate for example.com may not cover sub.example.com unless it was specifically issued for that subdomain.
  3. Wildcard Certificate Limitations: Wildcard certificates (e.g., *.example.com) cover all first-level subdomains but do not cover second-level subdomains (e.g., sub.sub.example.com).
  4. Self-Signed Certificates: If a self-signed certificate is used, it may not match the domain, leading to this error.

3、解决To resolve this issue:

  • Ensure that the URL being accessed matches the domain for which the SSL certificate was issued.
  • If you are the website owner, check your SSL certificate configuration and consider reissuing it if necessary.
  • For users, confirm that you are accessing the correct URL and not a phishing site.

4、参考:

https://www.quora.com/What-does-SSL_error_bad_cert_domain-mean

How to Fix SSL_ERROR_BAD_CERT_DOMAIN? Try These Methods - MiniTool

1625706 - Incorrect HTTPS error for wildcard certificate when subdomain ends in hyphen

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值