update 1.0.8.0

Commits for version update
This commit is contained in:
Manish Verma
2016-10-17 12:02:27 +05:30
parent dec927987b
commit 76e85db070
9674 changed files with 495757 additions and 58922 deletions

View File

@@ -2,6 +2,7 @@
namespace MaxMind\WebService;
use Composer\CaBundle\CaBundle;
use MaxMind\Exception\AuthenticationException;
use MaxMind\Exception\HttpException;
use MaxMind\Exception\InsufficientFundsException;
@@ -164,7 +165,6 @@ class Client
'userAgent' => $this->userAgent(),
)
);
}
/**
@@ -413,10 +413,17 @@ class Client
private function getCaBundle()
{
$cert = __DIR__ . '/cacert.pem';
$curlVersion = curl_version();
// Check if we are inside a phar. If so, we need to copy the cert to a
// temp file so that curl can see it.
// On OS X, when the SSL version is "SecureTransport", the system's
// keychain will be used.
if ($curlVersion['ssl_version'] ==='SecureTransport') {
return;
}
$cert = CaBundle::getSystemCaRootBundlePath();
// Check if the cert is inside a phar. If so, we need to copy the cert
// to a temp file so that curl can see it.
if (substr($cert, 0, 7) == 'phar://') {
$tempDir = sys_get_temp_dir();
$newCert = tempnam($tempDir, 'geoip2-');

View File

@@ -54,7 +54,9 @@ class CurlRequest implements Request
{
$curl = curl_init($this->url);
$opts[CURLOPT_CAINFO] = $this->options['caBundle'];
if (!empty($this->options['caBundle'])) {
$opts[CURLOPT_CAINFO] = $this->options['caBundle'];
}
$opts[CURLOPT_SSL_VERIFYHOST] = 2;
$opts[CURLOPT_FOLLOWLOCATION] = false;
$opts[CURLOPT_SSL_VERIFYPEER] = true;