openssl s_client 允许连接,但 curl 不允许

openssl s_client 允许连接,但 curl 不允许
grief@rocket:/$ curl https://wrong.host.badssl.com
curl: (60) SSL: no alternative certificate subject name matches target host name 'wrong.host.badssl.com'
More details here: https://curl.se/docs/sslcerts.html

curl failed to verify the legitimacy of the server and therefore could not
establish a secure connection to it. To learn more about this situation and
how to fix it, please visit the web page mentioned above.


grief@rocket:/$ echo "Q" | openssl s_client wrong.host.badssl.com:443 2>&1|grep Verification
Verification: OK

如何使用测试证书是否与主机名匹配openssl (1)

答案1

您需要使用该-verify_hostname <host>选项启用主机名验证。

相关内容