Merge pull request #16 from ryanxcharles/feature/add-ssl-config

add ssl config
This commit is contained in:
Ryan X. Charles 2013-12-12 12:51:46 -08:00
commit 21a182975c
2 changed files with 4 additions and 3 deletions

View File

@ -4,7 +4,8 @@ $bpconfig_port=443;
$bpconfig_hostAndPort=$bpconfig_host;
if ($bpconfig_port!=443)
$bpconfig_hostAndPort.=":".$bpconfig_port;
$bpconfig_ssl_verifypeer=1;
$bpconfig_ssl_verifyhost=2;
//include custom config overrides if it exists
if (file_exists('bp_config.php'))
require_once 'bp_config.php';

View File

@ -26,8 +26,8 @@ function bpCurl($url, $apiKey, $post = false) {
curl_setopt($curl, CURLOPT_HTTPHEADER, $header);
curl_setopt($curl, CURLOPT_TIMEOUT, 10);
curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC ) ;
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 1); // verify certificate
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 2); // check existence of CN and verify that it matches hostname
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, $bpconfig_ssl_verifypeer); // verify certificate
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, $bpconfig_ssl_verifyhost); // check existence of CN and verify that it matches hostname
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_FORBID_REUSE, 1);
curl_setopt($curl, CURLOPT_FRESH_CONNECT, 1);