Commit 683e392
authored
Add connection option WithSkipTLSHostVerify for privatelink host (#225)
## Background
The driver cannot connect to the workspace whose hostname is an internal
private link hostname, this is because its domain is not added into
Databricks workspace certificate. See
#223
## Description
This change adds connection option `WithSkipTLSHostVerify` which can
disable verifying the hostname in the server certificate. In this mode,
TLS is susceptible to machine-in-the-middle attacks. Please only use
this option when the hostname is an internal private link hostname.
Here is the usage
```go
connector, err := dbsql.NewConnector(
dbsql.WithServerHostname("<hostname>"),
dbsql.WithHTTPPath("<http_path>"),
dbsql.WithAccessToken("<token>"),
dbsql.WithSkipTLSHostVerify(),
)
```3 files changed
+50
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| |||
233 | 234 | | |
234 | 235 | | |
235 | 236 | | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
236 | 251 | | |
237 | 252 | | |
238 | 253 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
| 11 | + | |
10 | 12 | | |
11 | 13 | | |
12 | 14 | | |
| |||
38 | 40 | | |
39 | 41 | | |
40 | 42 | | |
| 43 | + | |
41 | 44 | | |
42 | 45 | | |
43 | 46 | | |
| |||
67 | 70 | | |
68 | 71 | | |
69 | 72 | | |
| 73 | + | |
70 | 74 | | |
71 | 75 | | |
72 | 76 | | |
| |||
184 | 188 | | |
185 | 189 | | |
186 | 190 | | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
187 | 213 | | |
188 | 214 | | |
189 | 215 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| |||
545 | 546 | | |
546 | 547 | | |
547 | 548 | | |
548 | | - | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
549 | 555 | | |
550 | 556 | | |
551 | 557 | | |
552 | 558 | | |
553 | 559 | | |
554 | 560 | | |
555 | 561 | | |
| 562 | + | |
556 | 563 | | |
557 | 564 | | |
558 | 565 | | |
| |||
577 | 584 | | |
578 | 585 | | |
579 | 586 | | |
580 | | - | |
| 587 | + | |
581 | 588 | | |
582 | 589 | | |
583 | 590 | | |
| |||
0 commit comments