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

Hostname verification failure when connecting via VPC Endpoint #123

Open
mac-macoy opened this issue Jan 27, 2023 · 2 comments
Open

Hostname verification failure when connecting via VPC Endpoint #123

mac-macoy opened this issue Jan 27, 2023 · 2 comments

Comments

@mac-macoy
Copy link

mac-macoy commented Jan 27, 2023

We connect from Spark to Redshift across VPCs using VPC Endpoints. When trying to connect with (in Databricks):

(
  spark.read
    .format("redshift")
    .option("url", "jdbc:redshift://VPCE_DNS_URL:PORT/DB")
    ...
)

we get the error:

java.sql.SQLException: The hostname VPCE_DNS_URL could not be verified by hostnameverifier RedshiftjdbcHostnameVerifier.

When we use the JDBC connector (.format("jdbc")) using the same URL, it connects and returns results.

We found that if we add ;sslmode=verify-ca to the URL, the Redshift connector works:

(
  spark.read
    .format("redshift")
    .option("url", "jdbc:redshift://VPCE_DNS_URL:PORT/DB;sslmode=verify-ca")
    ...
)
@jsleight
Copy link
Collaborator

Thanks for the report. Seems like you have a workaround as well.

I'm not sure if this is something we would want to add into the upstream or not. @kunaldeepsingh do you have intuition on that?

@aravishdatabricks
Copy link

@jsleight
Please at least add a hint in the error when this message is encountered
java.sql.SQLException: The hostname xxxxxxx could not be verified by hostnameverifier RedshiftjdbcHostnameVerifier.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants