(config: ProxyConfig)
| 85 | } |
| 86 | |
| 87 | function applyTlsVerificationOverride(config: ProxyConfig): void { |
| 88 | // Only relevant in debug mode with an active proxy. |
| 89 | if (!config.isDebugMode || !config.enabled) { |
| 90 | restoreTlsVerificationOverride() |
| 91 | return |
| 92 | } |
| 93 | |
| 94 | if (!config.tlsInsecure) { |
| 95 | restoreTlsVerificationOverride() |
| 96 | return |
| 97 | } |
| 98 | |
| 99 | if (!tlsVerificationOverridden) { |
| 100 | originalNodeTlsRejectUnauthorized = process.env.NODE_TLS_REJECT_UNAUTHORIZED |
| 101 | } |
| 102 | |
| 103 | // CodeQL: debug-only opt-in for MITM debugging. |
| 104 | process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0" // lgtm[js/disabling-certificate-validation] |
| 105 | tlsVerificationOverridden = true |
| 106 | } |
| 107 | |
| 108 | /** |
| 109 | * Initialize the network proxy module with the extension context. |
no test coverage detected