Home > Backend Development > PHP Tutorial > 请求https的有关问题

请求https的有关问题

WBOY
Release: 2016-06-13 13:29:09
Original
763 people have browsed it

请求https的问题
要做SSL,是不是一定要去http://www.verisign.com/网站上注册,购买证书吗?有还没其他方式,谢谢,指导!

------解决方案--------------------
function curlSSLrequest( $url,$postfield,$user_agent ){
$ch = curl_init();
curl_setopt($ch, CURLOPT_POST,1);
curl_setopt($ch, CURLOPT_POSTFIELDS,$postfield);
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST,1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_USERAGENT, $user_agent);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); // this line makes it work under https
$result=curl_exec($ch);
curl_close($ch);
return $result;
}

$user_agent = "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)";

需要你的服务器打开openSSL支持。
------解决方案--------------------
得买证书,
我们公司的商城就是用的ssl,这样看起来权威点.
自己颁发的要是能用,那颁发证书的公司其不是要饿死了.
自己颁发的只能在本地测试用.你打开https的网页浏览器会报当前的证书无效,或失效.你想一下,要是涉及到付款的,谁还敢在你的网站买东西啊
自己要想颁发得用windows 2000 或2003服务器版的系统. xp的没有证书服务.
安装证书服务后,在iis里申请个密匙他会生成在系统盘下.certreq.txt
再到证书服务器里颁发,再到iis里安装就可以了.

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template