This commit is contained in:
2026-04-03 22:35:49 +02:00
parent 0e7ee957cb
commit e95c4967d2
52 changed files with 7430 additions and 631 deletions

View File

@@ -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;
}
}