Skip to content

Commit 45b647b

Browse files
unknownunknown
authored andcommitted
Remove Verify_Peer Exploit #13
1 parent 41a72f3 commit 45b647b

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lib/shared/AuthorizeNetRequest.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ abstract class AuthorizeNetRequest
1111
protected $_api_login;
1212
protected $_transaction_key;
1313
protected $_post_string;
14-
public $VERIFY_PEER = true; // Set to false if getting connection errors.
14+
public $VERIFY_PEER = true; // attempt trust validation of SSL certificates when establishing secure connections.
1515
protected $_sandbox = true;
1616
protected $_log_file = false;
1717

@@ -94,7 +94,10 @@ protected function _sendRequest()
9494
if ($this->VERIFY_PEER) {
9595
curl_setopt($curl_request, CURLOPT_CAINFO, dirname(dirname(__FILE__)) . '/ssl/cert.pem');
9696
} else {
97-
curl_setopt($curl_request, CURLOPT_SSL_VERIFYPEER, false);
97+
if ($this->_log_file) {
98+
file_put_contents($this->_log_file, "----Request----\nInvalid SSL option\n", FILE_APPEND);
99+
}
100+
return false;
98101
}
99102

100103
if (preg_match('/xml/',$post_url)) {

0 commit comments

Comments
 (0)