Skip to content

Commit

Permalink
[Revert] [SNOW-799391] Add troubleshoot msg for ssl errors (#1407)
Browse files Browse the repository at this point in the history
* [Revert] [SNOW-799391] Add troubleshoot msg for ssl errors

* fix formatting issues
  • Loading branch information
sfc-gh-skumbham authored Jun 1, 2023
1 parent 81eb493 commit 7a69141
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 32 deletions.
9 changes: 1 addition & 8 deletions src/main/java/net/snowflake/client/jdbc/RestRequest.java
Original file line number Diff line number Diff line change
Expand Up @@ -232,14 +232,7 @@ public static CloseableHttpResponse execute(
// if an SSL issue occurs like an SSLHandshakeException then fail
// immediately and stop retrying the requests

String formattedMsg =
"No trusted certificate found.\n"
+ "Please make sure that the hostnames and port numbers listed in SYSTEM$ALLOWLIST are added to your firewall's allowed list.\n"
+ "To troubleshoot your connection further, you can refer to this article:\n"
+ "https://community.snowflake.com/s/article/Snowflake-Client-Connectivity-Troubleshooting. \n";

throw new SnowflakeSQLLoggedException(
null, ErrorCode.NETWORK_ERROR, ex, formattedMsg + ex.getMessage());
throw new SnowflakeSQLLoggedException(null, ErrorCode.NETWORK_ERROR, ex, ex.getMessage());

} catch (Exception ex) {

Expand Down
24 changes: 0 additions & 24 deletions src/test/java/net/snowflake/client/jdbc/ResultSetLatestIT.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
package net.snowflake.client.jdbc;

import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.CoreMatchers.instanceOf;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.Assert.*;

Expand All @@ -17,7 +16,6 @@
import java.sql.*;
import java.util.*;
import java.util.regex.Pattern;
import javax.net.ssl.SSLHandshakeException;
import net.snowflake.client.ConditionalIgnoreRule;
import net.snowflake.client.RunningOnGithubAction;
import net.snowflake.client.category.TestCategoryResultSet;
Expand Down Expand Up @@ -879,28 +877,6 @@ public void testAutoIncrementArrowResult() throws SQLException {
assertTrue(metaData.isAutoIncrement(3));
}

@Test
public void testSSLHandskakeError() {
Properties properties = new Properties();
properties.put("user", "fakeuser");
properties.put("password", "testpassword");
properties.put("ocspFailOpen", Boolean.FALSE.toString());
properties.put("loginTimeout", "1");
properties.put("tracing", "ALL");

try {
DriverManager.getConnection("jdbc:snowflake://expired.badssl.com/", properties);
fail("should fail");
} catch (SQLException e) {
assertThat(e.getCause(), instanceOf(SSLHandshakeException.class));
assertTrue(e.getMessage().contains("No trusted certificate found."));
assertTrue(
e.getMessage()
.contains(
"https://community.snowflake.com/s/article/Snowflake-Client-Connectivity-Troubleshooting."));
}
}

@Test
public void testGranularTimeFunctionsInSessionTimezone() throws SQLException {
Connection connection = null;
Expand Down

0 comments on commit 7a69141

Please sign in to comment.