Skip to content

Commit

Permalink
verifySsl method
Browse files Browse the repository at this point in the history
  • Loading branch information
maztch committed Jun 13, 2017
1 parent 0793807 commit c07e459
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/Ilovepdf.php
Original file line number Diff line number Diff line change
Expand Up @@ -298,4 +298,12 @@ public function getStatus($server, $taskId)

return $response->body;
}

/**
* @param $verify
*/
public function verifySsl($verify){
Request::verifyPeer($verify);
Request::verifyHost($verify);
}
}
3 changes: 3 additions & 0 deletions src/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,9 @@ public static function send($method, $url, $body = null, $headers = array(), $us
$info = self::getInfo();

if ($error) {
if(strpos($error,'SSL certificate problem')){
throw new \Exception($error.' Try using method verifySsl to false: "$ilovepdf->verifySsl(false)"');
}
throw new \Exception($error);
}

Expand Down

0 comments on commit c07e459

Please sign in to comment.