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

@@ -1,6 +1,22 @@
CHANGELOG
=========
0.3.1 (2016-08-10)
------------------
* On Mac OS X when using a curl built against SecureTransport, the certs
in the system's keychain will now be used instead of the CA bundle on
the file system.
0.3.0 (2016-08-09)
------------------
* This package now uses `composer/ca-bundle` by default rather than a CA
bundle distributed with this package. `composer/ca-bundle` will first try
to use the system CA bundle and will fall back to the Mozilla CA bundle
when no system bundle is available. You may still specify your own bundle
using the `caBundle` option.
0.2.1 (2016-06-13)
------------------

View File

@@ -13,6 +13,7 @@
],
"require": {
"php": ">=5.3",
"composer/ca-bundle": "^1.0.3",
"ext-curl": "*",
"ext-json": "*"
},

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;