Commit 2ad25cf
authored
fix: disable keep-alive on GoogleAuth transporter to avoid Premature close errors (#10717)
### Description
Disables HTTP keep-alive on the transporter utilized by `google-auth-library` to fetch and exchange auth tokens (e.g. via WIF or ADC). This works around a Node.js keep-alive socket reuse regression shipped in security updates for Node 22.23.0 and Node 24.17.0 (referenced in nodejs/node#63989) which causes token exchange requests to fail with `Premature close`.
Fixes #10716
### Scenarios Tested
Tested minimal reproduction script `scripts/repro.ts` under Node v24.17.0 using Application Default Credentials:
- Verified it fails on v15.22.1 and v15.22.2 (without the fix) with a `Premature close` GaxiosError.
- Verified it successfully passes after applying the fix, making the Google API call and receiving a standard API response.
- Ran all fast unit tests (`npm run mocha:fast`) successfully.1 parent a0a3d67 commit 2ad25cf
3 files changed
Lines changed: 14 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
168 | 168 | | |
169 | 169 | | |
170 | 170 | | |
171 | | - | |
| 171 | + | |
172 | 172 | | |
173 | 173 | | |
174 | 174 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
32 | 43 | | |
33 | 44 | | |
34 | 45 | | |
| |||
0 commit comments