diff --git a/LauncherCore/src/main/java/pro/gravit/launcher/LauncherTrustManager.java b/LauncherCore/src/main/java/pro/gravit/launcher/LauncherTrustManager.java index 4d0cd6c5..5ba6e684 100644 --- a/LauncherCore/src/main/java/pro/gravit/launcher/LauncherTrustManager.java +++ b/LauncherCore/src/main/java/pro/gravit/launcher/LauncherTrustManager.java @@ -57,6 +57,7 @@ private void injectCertificates() { final Map jdkTrustStore = getDefaultKeyStore(); // Создание нового KeyStore с дополнительными сертификатами. final KeyStore mergedTrustStore = KeyStore.getInstance(KeyStore.getDefaultType()); + mergedTrustStore.load(null, new char[0]); // добавление дополнительных сертификатов в новый KeyStore Arrays.stream(trustSigners).forEach(cert -> setCertificateEntry(mergedTrustStore, "injected-certificate" + UUID.randomUUID(), cert)); @@ -73,7 +74,7 @@ private void injectCertificates() { // Установка контекста по умолчанию HttpsURLConnection.setDefaultSSLSocketFactory(sslContext.getSocketFactory()); LogHelper.info("Successfully injected certificates to truststore"); - } catch (NoSuchAlgorithmException | KeyManagementException | KeyStoreException e) { + } catch (NoSuchAlgorithmException | KeyManagementException | KeyStoreException | IOException | CertificateException e) { LogHelper.error("Error while modify existing keystore"); } }