Skip to content

Commit b0c299e

Browse files
committed
Merge branch 'develop'
2 parents ac2555b + bd1d18f commit b0c299e

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/main/java/org/mariadb/jdbc/client/impl/StandardClient.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -432,6 +432,20 @@ public void authenticationHandler(Credential credential, HostAddress hostAddress
432432
authPluginFactory.initialize(
433433
credential.getPassword(), authSwitchPacket.getSeed(), conf, hostAddress);
434434

435+
if (certFingerprint != null
436+
&& (!authPlugin.isMitMProof()
437+
|| credential.getPassword() == null
438+
|| credential.getPassword().isEmpty())) {
439+
throw context
440+
.getExceptionFactory()
441+
.create(
442+
String.format(
443+
"Cannot use authentication plugin %s with a Self signed certificates."
444+
+ " Either set sslMode=trust, use password with a MitM-Proof"
445+
+ " authentication plugin or provide server certificate to client",
446+
authPluginFactory.type()));
447+
}
448+
435449
buf = authPlugin.process(writer, reader, context);
436450
break;
437451

0 commit comments

Comments
 (0)