【发布时间】:2021-02-22 22:08:48
【问题描述】:
我只找到了one S.O. Post on the error "NSS error -12276 (SSL_ERROR_BAD_CERT_DOMAIN)。”
我在 CentOS 服务器上的 localhost 上运行一个简单的 python 应用程序。 Python 应用程序只是一个小助手客户端,当 ManageIQ(此设备上运行的主应用程序)发出请求时,它会向外部 API 发出 http 请求。
python 应用程序突然停止接受请求。 ManageIQ 记录以下错误:
Errno::ECONNREFUSED: Failed to open TCP connection to localhost:8080 (Connection refused - connect(2) for "localhost" port 8080)
为了调试它,我在命令行上运行了 curl 命令:
curl --verbose http://localhost/flavors/Linux?name=Basic_A1
输出是:
* About to connect() to localhost port 80 (#0)
* Trying ::1...
* Connected to localhost (::1) port 80 (#0)
> GET /flavors/Linux?name=Basic_A1 HTTP/1.1
> User-Agent: curl/7.29.0
> Host: localhost
> Accept: */*
>
< HTTP/1.1 302 Found
< Date: Wed, 11 Nov 2020 16:17:57 GMT
< Server: Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips mod_auth_gssapi/1.5.1 mod_auth_kerb/5.4
< Location: https://localhost/flavors/Linux?name=Basic_A1
< Content-Length: 229
< Content-Type: text/html; charset=iso-8859-1
<
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>302 Found</title>
</head><body>
<h1>Found</h1>
<p>The document has moved <a href="https://localhost/flavors/Linux?name=Basic_A1">here</a>.</p>
</body></html>
* Connection #0 to host localhost left intact
这提示我需要 https,所以我尝试了curl --verbose https://localhost/flavors/Linux?name=Basic_A1
* About to connect() to localhost port 443 (#0)
* Trying ::1...
* Connected to localhost (::1) port 443 (#0)
* Initializing NSS with certpath: sql:/etc/pki/nssdb
* CAfile: /etc/pki/tls/certs/ca-bundle.crt
CApath: none
* Server certificate:
* subject: E=mike.butak@expeditors.com,CN=miq-dev.chq.ei,OU=IS-Systems Administration,O=Expeditors,C=US
* start date: Aug 24 22:20:01 2020 GMT
* expire date: May 11 22:20:01 2040 GMT
* common name: miq-dev.chq.ei
* issuer: CN=Expeditors Server CA,OU=IS Security,O=Expeditors,C=US
* 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.
一天中的大部分时间都在寻找修复方法。过去我也遇到过这种情况,可以通过在/etc/pki/ca-trust/source/anchors 文件夹中重新安装我们的公司根证书,然后按照this post on serverfault 运行update-ca-trust enable 和update-ca-trust extract 来轻松解决。但是今天由于某种原因它不起作用。
有什么建议吗?谢谢!
【问题讨论】:
标签: ssl tcp centos ssl-certificate