I've been using the @sendgrid/mail library fine until this evening I started getting the error _Client network socket disconnected before secure TLS connection was established_. Not sure how to go about troubleshooting this. Any ideas?
@brycelund you might try to connect with our support team https://support.sendgrid.com. But, it sounds like maybe a firewall or proxy issue? Did something change upstream in your environment?
I have also started to get this error periodically since a couple of weeks ago. No changes were made to our environment.
Seems to be almost a daily occurrence now
Thanks for reporting this @brycelund and @adamreisnz,
I've checked with our support team and they would like for you to submit a ticket please. Thank you!
Thanks will do
I'm also seeing this, we think might be realated with AWS load balancer
So far no luck through support for us. They've asked for more details regarding the outbound request, which we can't provide at this stage until we put some more logging in place.
I'm thinking the only thing we recently would have changed, is enabled for all API traffic to go through Cloudflare, but the request from the Heroku server to Sendgrid should for all intents and purposes be the same as it always has been.
Any update on this one @adamreisnz?
Not yet, I've had to travel abroad unexpectedly and have not been able to put more logging in place yet.
I suspect it's the same TLS snafu I've been struggling with. AFAICT, Node 10.x uses TLS2.3 by default, which means TLS1 and 1.1 have been deprecated. All things being equal, if the remote server admins have downgraded their TLS requirement, you have to add "secureProtocol: 'TLSv1_method'" to the http request options, or some other value that aligns with what they've done on the server side.
(I stumbled across this post while googling for the same error message, my use case however is connecting to an ancient AFIS system with TLS1.1 security for its SOAP server)
I hope this helps!!!
Does somebody solve this problem?
I didn't manage to solve it, but put more logging in place to help the Sendgrid team analyse it if it happens again. However, until now it hasn't re-occurred, so hoping it was a temporary disruption or routing issue.
I'm getting the same error as of today December 27.
Here's my AWS CloudWatch log:
2020-12-27T22:48:50.073Z 309306e9-0f6a-4105-bcec-0b12580e98e0 ERROR Uncaught Exception {
"errorType": "Error",
"errorMessage": "Client network socket disconnected before secure TLS connection was established",
"code": "ECONNRESET",
"path": null,
"host": "api.sendgrid.com",
"port": 443,
"stack": [
"Error: Client network socket disconnected before secure TLS connection was established",
" at connResetException (internal/errors.js:609:14)",
" at TLSSocket.onConnectEnd (_tls_wrap.js:1547:19)",
" at Object.onceWrapper (events.js:420:28)",
" at TLSSocket.emit (events.js:326:22)",
" at TLSSocket.EventEmitter.emit (domain.js:483:12)",
" at endReadableNT (_stream_readable.js:1223:12)",
" at processTicksAndRejections (internal/process/task_queues.js:84:21)"
]
}
I'm using Express to process the request through AWS Lambda. Locally it runs great, but when deployed I get this.
Any thoughts anyone?
Most helpful comment
I'm also seeing this, we think might be realated with AWS load balancer