update 1.0.8.0
Commits for version update
This commit is contained in:
@@ -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-');
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user