2929use App \Services \InfoProviderSystem \DTOs \PartDetailDTO ;
3030use App \Services \InfoProviderSystem \DTOs \PriceDTO ;
3131use App \Services \InfoProviderSystem \DTOs \PurchaseInfoDTO ;
32+ use Composer \CaBundle \CaBundle ;
3233use Symfony \Contracts \HttpClient \HttpClientInterface ;
3334
3435class Element14Provider implements InfoProviderInterface
@@ -43,9 +44,19 @@ class Element14Provider implements InfoProviderInterface
4344 private const COMPLIANCE_ATTRIBUTES = ['euEccn ' , 'hazardous ' , 'MSL ' , 'productTraceability ' , 'rohsCompliant ' ,
4445 'rohsPhthalatesCompliant ' , 'SVHC ' , 'tariffCode ' , 'usEccn ' , 'hazardCode ' ];
4546
46- public function __construct (private readonly HttpClientInterface $ element14Client , private readonly string $ api_key , private readonly string $ store_id )
47- {
47+ private readonly HttpClientInterface $ element14Client ;
4848
49+ public function __construct (HttpClientInterface $ element14Client , private readonly string $ api_key , private readonly string $ store_id )
50+ {
51+ /* We use the mozilla CA from the composer ca bundle directly, as some debian systems seems to have problems
52+ * with the SSL.COM CA, element14 uses. See https://github.com/Part-DB/Part-DB-server/issues/866
53+ *
54+ * This is a workaround until the issue is resolved in debian (or never).
55+ * As this only affects this provider, this should have no negative impact and the CA bundle is still secure.
56+ */
57+ $ this ->element14Client = $ element14Client ->withOptions ([
58+ 'cafile ' => CaBundle::getBundledCaBundlePath (),
59+ ]);
4960 }
5061
5162 public function getProviderInfo (): array
0 commit comments