Created
August 28, 2014 02:04
-
-
Save kino0104/8c198481558fc3537b98 to your computer and use it in GitHub Desktop.
PHPでcurlを使ってHTTPSにアクセスしてエラー出たときの回避策 ref: http://qiita.com/kino0104/items/8a6a6dc2404c27bc43ea
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$curl = curl_init(); | |
curl_setopt($curl, CURLOPT_URL, $url); | |
curl_setopt($curl, CURLOPT_POST, 1); | |
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($params)); | |
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); | |
//下記一行を追加 | |
curl_setopt($curl,CURLOPT_SSL_VERIFYPEER, false); | |
$res = curl_exec($curl); | |
curl_close($curl); | |
var_dump($res); | |
exit; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment