title: SSH tunnel not working with JDBC while trying to route HTTPS traffic
body: <p>I am trying to connect to Snowflake which only has port 443 open for communications using JDBC driver. Instead of directly connecting to the snowflake server I want to connect to it via tunnel server. So I've created a ssh tunnel from local machine to snowflake server. And I'm passing the forwarded local address and port as the host for the JDBC connection String. This is my final JDBC string.</p>
  
  <pre><code>jdbc:snowflake://127.0.0.1:21212/?db=TEST_DB&amp;warehouse=LOAD_WH&amp;user=&lt;user&gt;&amp;password=&lt;password&gt;
  </code></pre>
  
  <p>but the JDBC driver is not able to establish connection and fails during SSL handshake. Since the host address in the JDBC connection string doesn't have the format of that of the CN and SAN present in snowflake's SSL certificate.</p>
  
  <p>Adding the stacktrace along:- </p>
  
  <pre><code>javax.net.ssl.SSLPeerUnverifiedException: Certificate for &lt;10.11.227.124&gt; doesn't match any of the subject alternative names: [*.snowflakecomputing.com, snowflakecomputing.com]
  at net.snowflake.client.jdbc.internal.apache.http.conn.ssl.SSLConnectionSocketFactory.verifyHostname(SSLConnectionSocketFactory.java:467)
  at net.snowflake.client.jdbc.internal.apache.http.conn.ssl.SSLConnectionSocketFactory.createLayeredSocket(SSLConnectionSocketFactory.java:397)
  at net.snowflake.client.jdbc.internal.apache.http.conn.ssl.SSLConnectionSocketFactory.connectSocket(SSLConnectionSocketFactory.java:355)
  at net.snowflake.client.jdbc.internal.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:142)
  at net.snowflake.client.jdbc.internal.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:359)
  at net.snowflake.client.jdbc.internal.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:381)
  at net.snowflake.client.jdbc.internal.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:237)
  at net.snowflake.client.jdbc.internal.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:185)
  at net.snowflake.client.jdbc.internal.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:89)
  at net.snowflake.client.jdbc.internal.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:111)
  at net.snowflake.client.jdbc.internal.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:185)
  at net.snowflake.client.jdbc.internal.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:83)
  at net.snowflake.client.jdbc.internal.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:108)
  at net.snowflake.client.jdbc.internal.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:56)
  at net.snowflake.client.jdbc.RestRequest.execute(RestRequest.java:141)
  at net.snowflake.client.core.HttpUtil.executeRequestInternal(HttpUtil.java:280)
  at net.snowflake.client.core.HttpUtil.executeRequest(HttpUtil.java:234)
  at net.snowflake.client.core.SessionUtil.openSession(SessionUtil.java:906)
  at net.snowflake.client.core.SFSession.open(SFSession.java:330)
  at net.snowflake.client.jdbc.SnowflakeConnectionV1.&lt;init&gt;(SnowflakeConnectionV1.java:239)
  at net.snowflake.client.jdbc.SnowflakeDriver.connect(SnowflakeDriver.java:344)
  at java.sql.DriverManager.getConnection(DriverManager.java:664)
  at java.sql.DriverManager.getConnection(DriverManager.java:270)
  at org.apache.sqoop.manager.SqlManager.makeConnection(SqlManager.java:670)
  at org.apache.sqoop.manager.GenericJdbcManager.getConnection(GenericJdbcManager.java:52)
  at org.apache.sqoop.tool.EvalSqlTool.run(EvalSqlTool.java:70)
  at org.apache.sqoop.Sqoop.run(Sqoop.java:175)
  at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:65)
  at org.apache.sqoop.Sqoop.runSqoop(Sqoop.java:211)
  at org.apache.sqoop.Sqoop.runTool(Sqoop.java:250)
  at org.apache.sqoop.Sqoop.runTool(Sqoop.java:259)
  at org.apache.sqoop.Sqoop.main(Sqoop.java:268)
  at com.cloudera.sqoop.Sqoop.main(Sqoop.java:57)
  </code></pre>
  
  <p>Anyone has done similar thing in past and can guide me on how to do that?</p>