Skip to content

Commit

Permalink
Merge pull request #15 from Dmitry-Y-Kapustin/patch-1
Browse files Browse the repository at this point in the history
Avoid MITM vulnerability + minor changes
  • Loading branch information
viplifes authored Sep 21, 2017
2 parents 72bb3f2 + 306499e commit 8566527
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions LiqPay.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,11 @@ public function api($path, $params = array())

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true); // Avoid MITM vulnerability http://phpsecurity.readthedocs.io/en/latest/Input-Validation.html#validation-of-input-sources
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2); // Check the existence of a common name and also verify that it matches the hostname provided
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postfields);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$server_output = curl_exec($ch);
$this->_server_response_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
Expand Down

0 comments on commit 8566527

Please sign in to comment.