Skip to content

Commit

Permalink
#643 allow to skip verification of TLS certs for Trino connection
Browse files Browse the repository at this point in the history
  • Loading branch information
domnikl committed Dec 9, 2024
1 parent 4fc8b25 commit cff2d42
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 108 deletions.
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

0 comments on commit cff2d42

Please sign in to comment.