-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Description
Expected Behavior
When using the pre-request script in combination with proxy it should work without any difficulties.
Here's what the pre-request does: It does an HTTP call to an endpoint to fetch the access token for the main request and set it as an environment variable. Then the main request uses that token for auth to fetch the data.
But with this setup when I enable proxy, the main requests are timing out, the pre-request script still works and fetches the token, but the main request times out at the TLS Client Hello, and never finishes TLS Handshake.
Actual Behavior
I am a pentester and I get Insomnia API collections to pentest from the application teams. But lately the requests are timing out when there is some code in the pre-request script tab and the proxy is enabled. As a pentester I need burpsuite (my proxy tool) in between client (Insomnia) and server so I can scan all the requests, but they are timing out. In the console I can see that a log for outbound TLS Client hello but then the request freezes and times out.
Reproduction Steps
- Create a request and name ABC (name doesn't matter).
- In the certificates add mTLS certificates for the main host.
- In the preferences-> proxy set the proxy for burpsuite or any other tool. (By default burpsuite listens on 127.0.0.1:8080).
- Also in the preferences -> General (Request/Response section) disable the Validate Certificate.
- In the ABC request add the following Pre-Request Script:
const requestObj = { url: 'TOKEN_URL', method: 'POST', header: { 'Content-Type': 'application/json' }, body: { mode: 'raw', raw: JSON.stringify( { "data":"value" } ) } }; const resp = await new Promise((resolve, reject) => insomnia.sendRequest(requestObj, (err, resp) => { if (err) { reject(err); } else { resolve(resp); } }) ); const token = resp.json().token; insomnia.environment.set("token", token);- In the Auth tab use the {{_.token}}
- Send the request.
- In the proxy you will see that the TOKEN_URL is called to get the token, but the main request gets timed out.
- If you check the console you should see something like this at the end:
Enable automatic URL encoding Adding SSL PEM certificate Adding SSL KEY certificate Adding SSL PEM certificate Adding SSL KEY certificate Using default HTTP version Enable network proxy for https: Enable timeout of 30000ms Disable SSL validation Hostname 127.0.0.1 was found in DNS cache Trying 127.0.0.1:8080... Connected to (nil) (127.0.0.1) port 8080 (#9) ALPN: offers http/1.1 TLSv1.0 (OUT), TLS header, Certificate Status (22): TLSv1.3 (OUT), TLS handshake, Client hello (1): Operation timed out after 30000 milliseconds with 0 bytes received Closing connection 9
Is there an existing issue for this?
- I have searched the issue tracker for this problem.
Which sync method do you use?
- Git sync.
- Insomnia Cloud sync.
- Local only
Additional Information
No response
Insomnia Version
Version: Insomnia 11.4.0 Build date: 30/7/2025 OS: Windows_NT x64 10.0.26100 Electron: 35.1.5 Node: 22.14.0 Node ABI: 133 V8: 13.4.114.21-electron.0 Architecture: x64
What operating system are you using?
Windows
Operating System Version
Windows 11
Installation method
https://insomnia.rest/download -> Download for Windows
Last Known Working Insomnia version
don't know