Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ public class ContainerPgRule extends ExternalResource {

private static final String connectionUri = System.getProperty("connection.uri");
private static final String tlsConnectionUri = System.getProperty("tls.connection.uri");
private static final String tlsForceConnectionUri = System.getProperty("tls.force.connection.uri");

private ServerContainer<?> server;
private PgConnectOptions options;
Expand Down Expand Up @@ -95,7 +96,7 @@ private void initServer(String version) throws Exception {
}

public static boolean isTestingWithExternalDatabase() {
return isSystemPropertyValid(connectionUri) || isSystemPropertyValid(tlsConnectionUri);
return isSystemPropertyValid(connectionUri) || isSystemPropertyValid(tlsConnectionUri) || isSystemPropertyValid(tlsForceConnectionUri);
}

private static boolean isSystemPropertyValid(String systemProperty) {
Expand Down Expand Up @@ -144,7 +145,11 @@ protected void before() throws Throwable {
if (isTestingWithExternalDatabase()) {

if (ssl) {
options = PgConnectOptions.fromUri(tlsConnectionUri);
if (forceSsl) {
options = PgConnectOptions.fromUri(tlsForceConnectionUri);
} else {
options = PgConnectOptions.fromUri(tlsConnectionUri);
}
}
else {
options = PgConnectOptions.fromUri(connectionUri);
Expand Down
2 changes: 1 addition & 1 deletion vertx-pg-client/src/test/resources/tls/pg_hba.conf
Original file line number Diff line number Diff line change
Expand Up @@ -125,4 +125,4 @@ local replication all trust
host replication all 127.0.0.1/32 trust
host replication all ::1/128 trust

hostssl all all all scram-sha-256
hostssl all all all md5