nginx - Curl,证书的所有者与主机名不匹配

标签 nginx curl wget hostname

我有一个网站。
我试图让人们将他们网站上的文件下载到他们自己的机器上。
为了做到这一点,他们做 curl 或 wget。
它曾经总是有效,但现在突然间,运行它们是这样的:
wget https://somedomain/somefile.sh;

--2021-11-07 17:26:05--  https://somedomain/somefile.sh
Resolving some_domain (some_domain)... some_ip_address
Connecting to some_domain (some_domain)|ip_address|:443... connected.
ERROR: The certificate of ‘some_domain’ is not trusted.
ERROR: The certificate of ‘some_domain’ doesn't have a known issuer.
The certificate's owner does not match hostname ‘some_domain’
和 curl :
curl https://somedomain/somefile.sh 1>thefile;
curl: (60) SSL certificate problem: unable to get local issuer certificate
More details here: https://curl.haxx.se/docs/sslcerts.html

curl failed to verify the legitimacy of the server and therefore could not establish a secure connection to it.
我可以在我自己的机器上下载,但它在其他一些机器上不起作用。似乎它适用于某些机器而不是其他机器。
我尝试在服务器上执行 sudo apt-get update 和 upgrade,然后执行 sudo service nginx restart 然后重新启动。
没有改变任何东西。
我也更新了证书,尽管它声称这是不必要的。没有改变这个。
我也试过谷歌搜索,但我没有找到答案,我真的不明白我应该做什么才能让它工作。
我完全不知道如何解决这个问题。
我该如何解决这个问题?
任何提示将不胜感激。
即使只是朝着正确的方向插入。

最佳答案

开始前请检查正在解析的IP是否正确,报错The certificate's owner does not match hostname ‘some_domain’可能是到达错误服务器的信号。访问时serverA他们收到 serverB 的 IP , 当连接错误的 IP 时,whey 会向服务器索要证书,他们会收到 serverB证书,他们不会喜欢,因为他们期待 serverA ,所以他们提示主机名不匹配。

关于nginx - Curl,证书的所有者与主机名不匹配,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69872850/

相关文章:

mysql - nginx-tornado-django 请求超时

django nginx 设置问题

asp.net-mvc - 尝试通过 nginx/fastcgi 使用 eventsource 进行流式传输

linux - 使用 libcurl 的服务不能在 Debian 上自动启动?

json - Yahoo Placefinder API 和 cURL/wget

linux - 为什么 wget.exe 被检测为病毒?

docker - 从docker-compose运行的Nginx返回 “host not found in upstream”

php - ssl cURL - 将终端 curl 命令转换为 PHP 脚本

linux - wget 或类似程序是否始终在 POSIX 系统上可用?

php - curl:在重定向时保留 cookie