Skip to content

Instantly share code, notes, and snippets.

@notsobad
Last active September 13, 2017 09:03
Show Gist options
  • Save notsobad/7a11512b02522f45ef5a98657f383809 to your computer and use it in GitHub Desktop.
Save notsobad/7a11512b02522f45ef5a98657f383809 to your computer and use it in GitHub Desktop.

使用curl, 对于sni形式的ssl配置,host是在ssl协商阶段传送的,所以不能用 -H 'Host: xxxx.com'的形式来指定域名,而要使用--resolve参数

curl -vv --resolve www.yunaq.com.cn:443:1.2.3.4 https://www.yunaq.com.cn

使用openssl, 注意如果服务器是sni方式,需要加-servername参数来指定host

openssl s_client -showcerts -servername www.yunaq.com -connect 1.2.3.4:443
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment