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)
?
您需要使用该
-verify_hostname <host>
选项启用主机名验证。