-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Client network socket disconnected before secure TLS connection was established #23
Comments
When Proxman is not listening the error is Also tried:
from: https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/node-registering-certs.html Same error: "Client network socket disconnected before secure TLS connection was established" |
Thanks for the bug report @brandonregard. Is this code running on your local machine or on AWS Lambda? Also, does this happen on every attempt or just occasionally? |
On local machines and happens every time. |
Hi @brandonregard , I have a feature I'll be releasing shortly that will allow you to specify additional options including specifying the ca for requests. In the interim, can you try running your process using the It needs to be set prior to starting up the process (i.e. you can't do NODE_EXTRA_CA_CERTS="/Users/brandon/Desktop/proxyman.pem" import { addProxyToClient } from 'aws-sdk-v3-proxy';
...
const cognitoIdpCient: CognitoIdentityProviderClient = addProxyToClient(
new CognitoIdentityProviderClient({
region: REGION,
}),
{
debug: true,
}
);
...
const forgotPasswordCommand: ForgotPasswordCommand = new ForgotPasswordCommand({
ClientId: CLIENT_ID,
Username: PHONE,
});
forgotPasswordResponse = await cognitoIdpCient.send(forgotPasswordCommand); |
This change adds options for the proxy agent that can be passed in by the user. A couple uses for this include assigning certs and modifying headers used by the agent. close #23
This change adds options for the proxy agent that can be passed in by the user. A couple uses for this include assigning certs and modifying headers used by the agent. close #23
🎉 This issue has been resolved in version 2.1.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
The latest version now supports additional agent options. @brandonregard try updating to the latest version and executing the following: import { addProxyToClient } from 'aws-sdk-v3-proxy';
...
const certs = [readFileSync('/Users/brandon/Desktop/proxyman.pem').toString()];
const cognitoIdpCient: CognitoIdentityProviderClient = addProxyToClient(
new CognitoIdentityProviderClient({
region: REGION,
}),
{
debug: true,
agentOptions: {
rejectUnauthorized: true,
ca: certs,
}
}
);
...
const forgotPasswordCommand: ForgotPasswordCommand = new ForgotPasswordCommand({
ClientId: CLIENT_ID,
Username: PHONE,
});
forgotPasswordResponse = await cognitoIdpCient.send(forgotPasswordCommand); Let me know if you run into any additional issues, thanks! |
Current Behavior
Setting https proxy to https://172.20.7.148:9090
recoverIdToken error: TimeoutError: Client network socket disconnected before secure TLS connection was established
Works without "addProxyToClient".
Expected Behavior
Traffic is proxied through Proxyman.
Steps to Reproduce the Problem
Environment
The text was updated successfully, but these errors were encountered: