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

#643 allow to skip verification of TLS certs for Trino connection #716

Merged
merged 1 commit into from
Dec 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

116 changes: 16 additions & 100 deletions connectorx-python/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion connectorx/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ urlencoding = {version = "2.1", optional = true}
uuid = {version = "0.8", optional = true}
j4rs = {version = "0.15", optional = true}
datafusion = {version = "31", optional = true}
prusto = {version = "0.5.1", optional = true}
prusto = {version = "0.5.2", optional = true}
serde = {version = "1", optional = true}

[lib]
Expand Down
5 changes: 5 additions & 0 deletions connectorx/src/sources/trino/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,14 @@ impl TrinoSource {
username => username,
};

let no_verify = url
.query_pairs()
.any(|(k, v)| k == "verify" && v == "false");

let builder = ClientBuilder::new(username, url.host().unwrap().to_owned())
.port(url.port().unwrap_or(8080))
.ssl(prusto::ssl::Ssl { root_cert: None })
.no_verify(no_verify)
.secure(url.scheme() == "trino+https")
.catalog(url.path_segments().unwrap().last().unwrap_or("hive"));

Expand Down
6 changes: 3 additions & 3 deletions docs/databases/trino.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Trino

## Postgres Connection
## Connection

```{hint}
Using `trino+http` as connection protocol disables SSL for the connection. Example: `trino+http://host:port/catalog
Notice that basic auth requires SSL for Trino.
Using `trino+http` as connection protocol disables TLS for the connection. Example: `trino+http://host:port/catalog`
Notice that Trino requires TLS for basic auth credentials. To use self-signed certificates, add `verify=false` like this: `trino+https://host:port/catalog?verify=false`
```

```py
Expand Down
Loading