Skip to content
Snippets Groups Projects
Commit 2a0262de authored by eugene.livis's avatar eugene.livis
Browse files

Improvements

parent 189e16e5
Branches
No related tags found
No related merge requests found
...@@ -113,8 +113,8 @@ public class SleuthkitCase { ...@@ -113,8 +113,8 @@ public class SleuthkitCase {
private static final int IS_REACHABLE_TIMEOUT_MS = 1000; private static final int IS_REACHABLE_TIMEOUT_MS = 1000;
private static final String SQL_ERROR_CONNECTION_GROUP = "08"; private static final String SQL_ERROR_CONNECTION_GROUP = "08";
// either one of these mean connection was rejected by Postgres server // either one of these mean connection was rejected by Postgres server
private static final String SQL_CONNECTION_REJECTED_1 = "08004"; private static final String SQL_CONNECTION_REJECTED = "08004";
private static final String SQL_CONNECTION_REJECTED_2 = "08006"; private static final String UNABLE_TO_VERIFY_SSL = "08006";
private static final String SQL_ERROR_AUTHENTICATION_GROUP = "28"; private static final String SQL_ERROR_AUTHENTICATION_GROUP = "28";
private static final String SQL_ERROR_PRIVILEGE_GROUP = "42"; private static final String SQL_ERROR_PRIVILEGE_GROUP = "42";
...@@ -313,15 +313,15 @@ public static void tryConnect(CaseDbConnectionInfo info) throws TskCoreException ...@@ -313,15 +313,15 @@ public static void tryConnect(CaseDbConnectionInfo info) throws TskCoreException
} catch (SQLException ex) { } catch (SQLException ex) {
String result; String result;
String sqlState = ex.getSQLState().toLowerCase(); String sqlState = ex.getSQLState().toLowerCase();
if (sqlState.startsWith(SQL_ERROR_CONNECTION_GROUP)) { if (sqlState.startsWith(SQL_ERROR_CONNECTION_GROUP)) {
if (SQL_CONNECTION_REJECTED.equals(ex.getSQLState())) {
if (SQL_CONNECTION_REJECTED_1.equals(ex.getSQLState()) ||
SQL_CONNECTION_REJECTED_2.equals(ex.getSQLState())) {
if (info.isSslEnabled()) { if (info.isSslEnabled()) {
result = "Server rejected the SSL connection attempt. Check SSL configuration."; result = "Server rejected the SSL connection attempt. Check SSL configuration.";
} else { } else {
result = "Server rejected the connection attempt. Check server configuration."; result = "Server rejected the connection attempt. Check server configuration.";
} }
} else if (UNABLE_TO_VERIFY_SSL.equals(ex.getSQLState())) {
result = "Unable to verify SSL certificates. Check SSL configuration.";
} else { } else {
try { try {
if (InetAddress.getByName(info.getHost()).isReachable(IS_REACHABLE_TIMEOUT_MS)) { if (InetAddress.getByName(info.getHost()).isReachable(IS_REACHABLE_TIMEOUT_MS)) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment