Commit 54e5559
authored
Propagate DIFC proxy TLS CA trust to git/gh/curl via process environment (#4042)
`gh repo clone` / `git clone` failed through the DIFC TLS proxy
(`https://localhost:18443/...`) because clients could not validate the
proxy’s generated certificate chain. This change propagates the
generated proxy CA to the toolchains that perform HTTPS validation in
agent workflows.
- **Proxy startup: propagate CA trust to common clients**
- On `awmg proxy --tls`, set process env vars to the generated `ca.crt`:
- `NODE_EXTRA_CA_CERTS`
- `SSL_CERT_FILE`
- `GIT_SSL_CAINFO`
- `CURL_CA_BUNDLE`
- `REQUESTS_CA_BUNDLE`
- This covers `gh`, `git`, `curl`, and other TLS consumers that honor
standard CA env settings.
- **No `GITHUB_ENV` dependency**
- TLS trust propagation no longer reads or writes `GITHUB_ENV`.
- Proxy startup relies only on process environment exports for trust
configuration.
- **Operator-facing output and docs**
- Proxy connection hints include git-relevant exports (`SSL_CERT_FILE`,
`GIT_SSL_CAINFO`).
- `docs/PROXY_MODE.md` documents CA setup for `gh` + `git` without
`GITHUB_ENV` automation.
- **Focused unit coverage**
- Added/updated tests for:
- env var propagation
- no reliance on `GITHUB_ENV` (including asserting the file remains
unchanged)
- rejection of newline-containing CA paths
```go
var tlsTrustEnvKeys = []string{
"NODE_EXTRA_CA_CERTS",
"SSL_CERT_FILE",
"GIT_SSL_CAINFO",
"CURL_CA_BUNDLE",
"REQUESTS_CA_BUNDLE",
}
```
> [!WARNING]
>
>3 files changed
+79
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
| 26 | + | |
25 | 27 | | |
26 | 28 | | |
27 | 29 | | |
| |||
167 | 169 | | |
168 | 170 | | |
169 | 171 | | |
| 172 | + | |
| 173 | + | |
170 | 174 | | |
171 | 175 | | |
172 | 176 | | |
| |||
219 | 223 | | |
220 | 224 | | |
221 | 225 | | |
| 226 | + | |
| 227 | + | |
222 | 228 | | |
223 | 229 | | |
224 | 230 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| |||
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
27 | 36 | | |
28 | 37 | | |
29 | 38 | | |
| |||
223 | 232 | | |
224 | 233 | | |
225 | 234 | | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
226 | 238 | | |
227 | 239 | | |
228 | 240 | | |
| |||
268 | 280 | | |
269 | 281 | | |
270 | 282 | | |
| 283 | + | |
| 284 | + | |
271 | 285 | | |
272 | 286 | | |
273 | 287 | | |
| |||
302 | 316 | | |
303 | 317 | | |
304 | 318 | | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
409 | 409 | | |
410 | 410 | | |
411 | 411 | | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
0 commit comments