File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed
src/Library/KeyManagement/KeyConverter Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change 1818use function in_array ;
1919use function is_array ;
2020use function is_string ;
21+ use const E_ERROR ;
22+ use const E_PARSE ;
2123use const OPENSSL_KEYTYPE_EC ;
2224use const OPENSSL_KEYTYPE_RSA ;
2325use const OPENSSL_RAW_DATA ;
@@ -48,6 +50,7 @@ public static function loadKeyFromCertificate(string $certificate): array
4850 throw new RuntimeException ('Please install the OpenSSL extension ' );
4951 }
5052
53+ $ errorReporting = error_reporting (E_ERROR | E_PARSE );
5154 try {
5255 $ res = openssl_x509_read ($ certificate );
5356 if ($ res === false ) {
@@ -56,6 +59,8 @@ public static function loadKeyFromCertificate(string $certificate): array
5659 } catch (Throwable ) {
5760 $ certificate = self ::convertDerToPem ($ certificate );
5861 $ res = openssl_x509_read ($ certificate );
62+ } finally {
63+ error_reporting ($ errorReporting );
5964 }
6065 if ($ res === false ) {
6166 throw new InvalidArgumentException ('Unable to load the certificate. ' );
You can’t perform that action at this time.
0 commit comments