编程语言
首页 > 编程语言> > PHP Use CURL with SNI

PHP Use CURL with SNI

作者:互联网

--resolve [DOMAIN]:[PORT]:[IP]
curl -k -I --resolve adfs.mysite.com:443:192.168.1.100 https://adfs.mysite.com/
$url = "https://adfs.mysite.com";
$resolve = "adfs.mysite.com:443:192.168.1.100 https://adfs.mysite.com/";
$curl = curl_init();//初始化curl
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_RESOLVE, array($resolve));
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);//跳过证书检测,信任任何证书
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 0); // 检查证书中是否设置域名
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);//要求结果为字符串且不输出到屏幕上
curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 60);//设置等待时间
$Res = curl_exec($curl);
curl_close($curl);

参考链接:
https://hacksbrain.com/2018/08/27/testing-sni-enabled-servers-with-curl/

标签:Use,setopt,adfs,CURL,PHP,com,curl,CURLOPT,mysite
来源: https://www.cnblogs.com/KillBugMe/p/13132302.html