update
This commit is contained in:
@@ -3,6 +3,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Modules\Shipments;
|
||||
|
||||
use App\Core\Http\SslCertificateResolver;
|
||||
use App\Modules\Settings\InpostIntegrationRepository;
|
||||
use Throwable;
|
||||
|
||||
@@ -91,7 +92,7 @@ final class InpostTrackingService implements ShipmentTrackingInterface
|
||||
],
|
||||
];
|
||||
|
||||
$caPath = $this->getCaBundlePath();
|
||||
$caPath = SslCertificateResolver::resolve();
|
||||
if ($caPath !== null) {
|
||||
$opts[CURLOPT_CAINFO] = $caPath;
|
||||
}
|
||||
@@ -109,20 +110,4 @@ final class InpostTrackingService implements ShipmentTrackingInterface
|
||||
return is_array($json) ? $json : [];
|
||||
}
|
||||
|
||||
private function getCaBundlePath(): ?string
|
||||
{
|
||||
$candidates = [
|
||||
(string) ($_ENV['CURL_CA_BUNDLE_PATH'] ?? ''),
|
||||
(string) ini_get('curl.cainfo'),
|
||||
'C:/xampp/apache/bin/curl-ca-bundle.crt',
|
||||
'C:/xampp/php/extras/ssl/cacert.pem',
|
||||
'/etc/ssl/certs/ca-certificates.crt',
|
||||
];
|
||||
foreach ($candidates as $path) {
|
||||
if ($path !== '' && is_file($path)) {
|
||||
return $path;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user