Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SNOW-1511475: nonProxyHosts not honoured correctly #1808

Closed
jeromartin opened this issue Jun 28, 2024 · 2 comments
Closed

SNOW-1511475: nonProxyHosts not honoured correctly #1808

jeromartin opened this issue Jun 28, 2024 · 2 comments
Assignees
Labels
invalid status-triage_done Initial triage done, will be further handled by the driver team

Comments

@jeromartin
Copy link

jeromartin commented Jun 28, 2024

Please answer these questions before submitting your issue.
In order to accurately debug the issue this information is required. Thanks!

  1. What version of JDBC driver are you using?
    3,13,34 -> 3.16.1

  2. What operating system and processor architecture are you using?
    Mac/Linux x86/ARM

  3. What version of Java are you using?
    17

  4. What did you do?
    When using proxy configuration (either via java option or the jdbc url) nonProxyHosts parameter is not interpreted correctly.
    jdbc:snowflake://account_name.snowflakecomputing.com/?db=XXX&role=SYSADMIN&useProxy=true&proxyHost=proxy.example.com&proxyPort=443&nonProxyHosts=account_name.snowflakecomputing.com.
    This configuration will NOT bypass the proxy despite having the host set in nonProxyHosts. In order for it to work, you need to configure it with a *: jdbc:snowflake://account_name.snowflakecomputing.com/?db=XXX&role=SYSADMIN&useProxy=true&proxyHost=proxy.example.com&proxyPort=443&nonProxyHosts=*.snowflakecomputing.com

  5. What did you expect to see?

Proxy should be bypassed when specifying the full host in nonProxyHosts and not only with *.domain.

  1. Can you set logging to DEBUG and collect the logs?

    https://community.snowflake.com/s/article/How-to-generate-log-file-on-Snowflake-connectors

  2. What is your Snowflake account identifier, if any? (Optional)

@jeromartin jeromartin added the bug label Jun 28, 2024
@github-actions github-actions bot changed the title nonProxyHosts not honoured correctly SNOW-1511475: nonProxyHosts not honoured correctly Jun 28, 2024
@sfc-gh-wfateem sfc-gh-wfateem self-assigned this Jul 1, 2024
@sfc-gh-wfateem
Copy link
Collaborator

Hey @jeromartin,

FYI I edited your comment to replace the actual hostname with an example hostname.

I'm pretty certain that the nonProxyHosts option works from my recent testing when building out another feature. I think your issue is that you're using the hostname account_name.snowflakecomputing.com and starting with version 3.13.25 we replace all underscore characters with a hyphen, so really your JDBC driver is making a connection to the host account-name.snowflakecomputing.com which is why in your case it only works when you configure the nonProxyHosts parameter to bypass everything under the snowflakecomputing.com domain. You can change the behavior by changing the value of the allowUnderscoresInHost to true.

Try either:

1.) Using the hostname account-name.snowflakecomputing.com in the nonProxyHosts parameter

or

2.) Add the connection parameter:
allowUnderscoresInHost=true

Please give that a try and let me know if that helps.

@sfc-gh-wfateem sfc-gh-wfateem added status-triage_done Initial triage done, will be further handled by the driver team invalid and removed bug labels Jul 1, 2024
@jeromartin
Copy link
Author

Hey @sfc-gh-wfateem ,

Thank you for the information! It is indeed doing the trick, both allow the nonProxyHosts to be applied correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid status-triage_done Initial triage done, will be further handled by the driver team
Projects
None yet
Development

No branches or pull requests

2 participants