From 443279a3f8a929320721aaaa7c16fa3178e6e024 Mon Sep 17 00:00:00 2001 From: Jesper Blomquist Date: Thu, 18 Apr 2024 15:14:16 +0200 Subject: [PATCH] make trustStorePassword be null if this.trustStoreSettings.keyStorePassword is null --- .../core-impl/java/com/mysql/cj/protocol/ExportControlled.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/core-impl/java/com/mysql/cj/protocol/ExportControlled.java b/src/main/core-impl/java/com/mysql/cj/protocol/ExportControlled.java index 6a5a3cfda..c5fbb744f 100644 --- a/src/main/core-impl/java/com/mysql/cj/protocol/ExportControlled.java +++ b/src/main/core-impl/java/com/mysql/cj/protocol/ExportControlled.java @@ -547,7 +547,7 @@ public SSLContext build() { if (this.verifyServerCertificate) { KeyStore trustKeyStore = null; if (!StringUtils.isNullOrEmpty(this.trustStoreSettings.keyStoreUrl) && !StringUtils.isNullOrEmpty(this.trustStoreSettings.keyStoreType)) { - char[] trustStorePassword = this.trustStoreSettings.keyStorePassword == null ? new char[0] + char[] trustStorePassword = this.trustStoreSettings.keyStorePassword == null ? null : this.trustStoreSettings.keyStorePassword.toCharArray(); trustStoreIS = new URL(this.trustStoreSettings.keyStoreUrl).openStream(); trustKeyStore = StringUtils.isNullOrEmpty(this.keyStoreProvider) ? KeyStore.getInstance(this.trustStoreSettings.keyStoreType)