disable ssl verification

This commit is contained in:
gnieark 2016-06-06 13:12:01 +02:00
parent 4c03488d16
commit 3d26cba5bd
2 changed files with 6 additions and 6 deletions

View File

@ -36,9 +36,7 @@ switch ($_POST['act']){
}
get_IA_Response($bots[$bot1]['url'],$params[0]); //don't care about result
get_IA_Response($bots[$bot2]['url'],$params[1]); //don't care about result
//"game-id":"gameid","action":"init","game":"tictactoe","players":2,"board":null,"you":null,"player-index":0}
//[0000] body> {"name":"moul-tictactoe","play":null,"error":null}
$playerPlayingNow=1;
@ -126,7 +124,7 @@ switch ($_POST['act']){
$playerPlayingNow=1;
}
}else{
echo "<p>".$playerName." a fait une réponse non conforme. Il perd</p><p>".json_encode($playerResponse)."</p>";
echo "<p>".$playerName." a fait une réponse non conforme. Il perd.</p>";
break;
}

View File

@ -40,7 +40,9 @@ function get_IA_Response($iaUrl,$postParams){
$data_string = json_encode($postParams);
$ch = curl_init($iaUrl);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
@ -49,6 +51,6 @@ function get_IA_Response($iaUrl,$postParams){
);
$output= curl_exec($ch);
curl_close($ch);
echo $iaUrl." ".$data_string." ".$output.'<br/>';
//echo $iaUrl." ".$data_string." ".$output.'<br/>';
return json_decode($output,TRUE);
}