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

Connect: Expose option to set protocol #140

Closed
MovieStoreGuy opened this issue Jul 3, 2023 · 4 comments
Closed

Connect: Expose option to set protocol #140

MovieStoreGuy opened this issue Jul 3, 2023 · 4 comments

Comments

@MovieStoreGuy
Copy link

Context

The method WithServerHostname will configure the protocol used to http if the value provided is localhost, however, it can be possible to try connector a compliant databricks service via a local proxy that does the TLS termination.

Diagram

service --> reverse proxy --> service

Outcomes

I am open to either outcome of:

  • New option that can parse a complete URL and apply the WithProtocol, WithHostname, WithPort, WithHTTPPath configuration values
  • New option that allows forcing http connection via a new option WithHTTPProtocol
@rcypher-databricks
Copy link
Contributor

Just to verify: you are not using a dsn to connect, you are using NewConnector().

@MovieStoreGuy
Copy link
Author

Yes, sorry that is correct.

rcypher-databricks added a commit to rcypher-databricks/databricks-sql-go that referenced this issue Aug 2, 2023
… be added in to an error chain to signal that a connection should no longer be used and to retry with a new connection.

Updated ThriftServiceClient error handling. When a Thrift request fails we are now checking the error message for the term 'Invalid SessionHandle'.  If it is present we are adding a bad connection error to the error chain.  Searching in the error message is clumsy and fragile but there doesn't currently appear to be another way to get the information.

Updated the WithServerHostname function to handle host names prefixed by 'http:' or 'https:' to allow users to specify which protocol to use.  This is in response to github issue databricks#140.

Signed-off-by: Raymond Cypher <raymond.cypher@databricks.com>
rcypher-databricks added a commit to rcypher-databricks/databricks-sql-go that referenced this issue Aug 3, 2023
Updated WithServerHostname to allow prefixing the hostname with 'https:' or 'http:' to specify which protocol to use.
Github issue databricks#140
Signed-off-by: Raymond Cypher <raymond.cypher@databricks.com>
rcypher-databricks added a commit that referenced this issue Aug 3, 2023
Updated WithServerHostname to allow prefixing the hostname with 'https:'
or 'http:' to specify which protocol to use. Github issue #140
Signed-off-by: Raymond Cypher <raymond.cypher@databricks.com>
@rcypher-databricks
Copy link
Contributor

Version 1.4.0 has been released and allows for including http or https protocol when using WithServerHostname
ex. WithServerHostname("http:my.server.name")

rcypher-databricks added a commit that referenced this issue Aug 30, 2023
…ol. (#152)

Added a new error type that identifies as driver.ErrBadConn. This can be
added in to an error chain to signal that a connection should no longer
be used and to retry with a new connection.

Updated ThriftServiceClient error handling. When a Thrift request fails
we are now checking the error message for the term 'Invalid
SessionHandle'. If it is present we are adding a bad connection error to
the error chain. Searching in the error message is clumsy and fragile
but there doesn't currently appear to be another way to get the
information.

Updated the WithServerHostname function to handle host names prefixed by
'http:' or 'https:' to allow users to specify which protocol to use.
This is in response to github issue #140.
@rcypher-databricks
Copy link
Contributor

Unless there are still problems with this we will close this issue.

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

2 participants