Skip to content

Commit 806b13f

Browse files
committed
Fixed unlogged security exceptions warning
1 parent ad72de8 commit 806b13f

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

core/src/main/java/tech/ydb/core/ssl/MultiX509TrustManager.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,12 @@
88

99
import javax.net.ssl.X509TrustManager;
1010

11+
import org.slf4j.Logger;
12+
import org.slf4j.LoggerFactory;
13+
1114
final class MultiX509TrustManager implements X509TrustManager {
15+
private static final Logger logger = LoggerFactory.getLogger(MultiX509TrustManager.class);
16+
1217
final List<X509TrustManager> trustManagers;
1318

1419
MultiX509TrustManager(final List<X509TrustManager> trustManagers) {
@@ -23,6 +28,7 @@ public void checkClientTrusted(final X509Certificate[] x509Certificates, final S
2328
trustManager.checkClientTrusted(x509Certificates, authType);
2429
return;
2530
} catch (CertificateException ignored) {
31+
logger.trace("cannot use trust manager {}", trustManager, ignored);
2632
}
2733
}
2834
throw new CertificateException("No trust manager trusts this certificates");
@@ -36,6 +42,7 @@ public void checkServerTrusted(final X509Certificate[] x509Certificates, final S
3642
trustManager.checkServerTrusted(x509Certificates, authType);
3743
return;
3844
} catch (CertificateException ignored) {
45+
logger.trace("cannot use trust manager {}", trustManager, ignored);
3946
}
4047
}
4148
throw new CertificateException("No trust manager trusts this certificates");

core/src/main/java/tech/ydb/core/ssl/YandexTrustManagersProvider.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,12 @@
1616
import javax.net.ssl.TrustManagerFactory;
1717
import javax.net.ssl.X509TrustManager;
1818

19+
import org.slf4j.Logger;
20+
import org.slf4j.LoggerFactory;
21+
1922
final class YandexTrustManagersProvider {
23+
private static final Logger logger = LoggerFactory.getLogger(YandexTrustManagerFactory.class);
24+
2025
private static final String YANDEX_CA_STORE = "certificates/YandexAllCAs.pkcs";
2126
private static final String STORE_PASSWORD = "yandex";
2227

@@ -40,6 +45,7 @@ private YandexTrustManagersProvider() {
4045
allTrustManagers.add(composite);
4146
trustManagers = allTrustManagers.toArray(new TrustManager[0]);
4247
} catch (NoSuchAlgorithmException | KeyStoreException | CertificateException | IOException e) {
48+
logger.debug("Can't init yandex root CA settings", e);
4349
String msg = "Can't init yandex root CA setting";
4450
throw new RuntimeException(msg, e);
4551
}

0 commit comments

Comments
 (0)