29
29
use App \Services \InfoProviderSystem \DTOs \PartDetailDTO ;
30
30
use App \Services \InfoProviderSystem \DTOs \PriceDTO ;
31
31
use App \Services \InfoProviderSystem \DTOs \PurchaseInfoDTO ;
32
+ use Composer \CaBundle \CaBundle ;
32
33
use Symfony \Contracts \HttpClient \HttpClientInterface ;
33
34
34
35
class Element14Provider implements InfoProviderInterface
@@ -43,9 +44,19 @@ class Element14Provider implements InfoProviderInterface
43
44
private const COMPLIANCE_ATTRIBUTES = ['euEccn ' , 'hazardous ' , 'MSL ' , 'productTraceability ' , 'rohsCompliant ' ,
44
45
'rohsPhthalatesCompliant ' , 'SVHC ' , 'tariffCode ' , 'usEccn ' , 'hazardCode ' ];
45
46
46
- public function __construct (private readonly HttpClientInterface $ element14Client , private readonly string $ api_key , private readonly string $ store_id )
47
- {
47
+ private readonly HttpClientInterface $ element14Client ;
48
48
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
+ ]);
49
60
}
50
61
51
62
public function getProviderInfo (): array
0 commit comments