Skip to content

Commit 5e190f4

Browse files
Merge pull request #103 from oracle/102-dn-match-ignored
DN Matching Option Fix
2 parents 4c80abe + 3e39efb commit 5e190f4

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

src/main/java/oracle/r2dbc/impl/OracleReactiveJdbcAdapter.java

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -400,11 +400,18 @@ private static String composeJdbcUrl(ConnectionFactoryOptions options) {
400400
PORT, options, Integer.class, Integer::valueOf);
401401
Object serviceName = options.getValue(DATABASE);
402402

403-
return String.format("jdbc:oracle:thin:@%s%s%s%s",
403+
Object dnMatch =
404+
options.getValue(OracleR2dbcOptions.TLS_SERVER_DN_MATCH);
405+
406+
return String.format("jdbc:oracle:thin:@%s%s%s%s?%s=%s",
404407
protocol == null ? "" : protocol + "://",
405408
host,
406409
port != null ? (":" + port) : "",
407-
serviceName != null ? ("/" + serviceName) : "");
410+
serviceName != null ? ("/" + serviceName) : "",
411+
// Workaround for Oracle JDBC bug #33150409. DN matching is enabled
412+
// unless the property is set as a query parameter.
413+
OracleR2dbcOptions.TLS_SERVER_DN_MATCH.name(),
414+
dnMatch == null ? "false" : dnMatch);
408415
}
409416
}
410417

src/test/java/oracle/r2dbc/impl/OracleReactiveJdbcAdapterTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -634,7 +634,8 @@ public void testTimezoneAsRegion() {
634634
// than a name (Europe/Warsaw).
635635
Connection connection = awaitOne(ConnectionFactories.get(
636636
ConnectionFactoryOptions.parse(format(
637-
"r2dbc:oracle://%s:%d/%s?oracle.jdbc.timezoneAsRegion=false",
637+
"r2dbc:oracle%s://%s:%d/%s?oracle.jdbc.timezoneAsRegion=false",
638+
protocol() == null ? "" : ":" + protocol(),
638639
host(), port(), serviceName()))
639640
.mutate()
640641
.option(USER, user())

0 commit comments

Comments
 (0)