From b01be976d422dcb48e69d0243f9e6cf5f1d0dc63 Mon Sep 17 00:00:00 2001 From: Kevin Wooten Date: Tue, 27 Oct 2020 23:00:14 -0700 Subject: [PATCH] Add channel closed to allowable failures for bad client certificates According to mainline driver tests this is a somewhate expected error. --- .../java/com/impossibl/postgres/jdbc/SSLDataSourceTest.java | 2 +- driver/src/test/java/com/impossibl/postgres/jdbc/SSLTest.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/driver/src/test/java/com/impossibl/postgres/jdbc/SSLDataSourceTest.java b/driver/src/test/java/com/impossibl/postgres/jdbc/SSLDataSourceTest.java index 7a47858f3..b21281185 100644 --- a/driver/src/test/java/com/impossibl/postgres/jdbc/SSLDataSourceTest.java +++ b/driver/src/test/java/com/impossibl/postgres/jdbc/SSLDataSourceTest.java @@ -246,7 +246,7 @@ private static Collection testData(Properties prop, String param) { static { String PG_HBA_ON = "Connection Error: no pg_hba.conf entry for host .*, user .*, database .*, SSL on(?s-d:.*)"; String PG_HBA_OFF = "Connection Error: no pg_hba.conf entry for host .*, user .*, database .*, SSL off(?s-d:.*)"; - String BROKEN = "Connection Error: SSL Error: Received fatal alert: unknown_ca"; + String BROKEN = "Connection Error: (Channel Closed|SSL Error: Received fatal alert: unknown_ca)"; String ANY = ".*"; String VALIDATOR = "Connection Error: SSL Error: PKIX path (building|validation) failed:.*"; String HOSTNAME = "Connection Error: SSL Error: Hostname .* could not be verified"; diff --git a/driver/src/test/java/com/impossibl/postgres/jdbc/SSLTest.java b/driver/src/test/java/com/impossibl/postgres/jdbc/SSLTest.java index 390ba5eba..1861b5d96 100644 --- a/driver/src/test/java/com/impossibl/postgres/jdbc/SSLTest.java +++ b/driver/src/test/java/com/impossibl/postgres/jdbc/SSLTest.java @@ -139,7 +139,7 @@ protected void driver(String connstr, Object[] expected) { else { StringWriter trace = new StringWriter(); ex.printStackTrace(new PrintWriter(trace)); - assertTrue("Unexpected Exception Message: " + ex.getMessage() + "\nfrom\n" + trace.toString(), ex.getMessage().matches(exmsg)); + assertTrue("Unexpected Exception Message: " + ex.getMessage() + "\nexpected: " + exmsg + "\nfrom\n" + trace.toString(), ex.getMessage().matches(exmsg)); } } } @@ -209,7 +209,7 @@ private static Collection testData(Properties prop, String param) thro static { String PG_HBA_ON = "Connection Error: no pg_hba.conf entry for host .*, user .*, database .*, SSL on(?s-d:.*)"; String PG_HBA_OFF = "Connection Error: no pg_hba.conf entry for host .*, user .*, database .*, SSL off(?s-d:.*)"; - String BROKEN = "Connection Error: SSL Error: Received fatal alert: unknown_ca"; + String BROKEN = "Connection Error: (Channel Closed|SSL Error: Received fatal alert: unknown_ca)"; String ANY = ".*"; String VALIDATOR = "Connection Error: SSL Error: PKIX path (building|validation) failed:.*"; String HOSTNAME = "Connection Error: SSL Error: Hostname .* could not be verified";