got icon indicating copy to clipboard operation
got copied to clipboard

Got breaks when secure renegotiation is not supported by remote resource

Open iTim314 opened this issue 1 year ago • 1 comments

What problem are you trying to solve?

I am receiving the following error after upgrading to Node 18: RequestError: write EPROTO C0F7F892E27F0000:error:0A000152:SSL routines:final_renegotiate:unsafe legacy renegotiation disabled:../deps/openssl/openssl/ssl/statem/extensions.c:922:

Describe the feature

Nodejs has a secureOptions property that should be passed through got's HttpsOptions type for connection options. This would allow for the use of the flag SSL_OP_LEGACY_SERVER_CONNECT. Right now, HttpsOptions is limited in scope. https://github.com/sindresorhus/got/blob/b1d61c173a681755ac23afb2f155f08801c1e7e4/documentation/5-https.md#other-https-options

Unfortunately there is no workaround. My homebridge plugin is dead in the water because the API host is behind the times and I cannot control their infrastructure.

Checklist

  • [ X ] I have read the documentation and made sure this feature doesn't already exist.

iTim314 avatar Jun 16 '23 23:06 iTim314

I have the same issue. Providing custom --openssl-config via NODE_OPTIONS worked for me. This is the reference I followed https://stackoverflow.com/a/76033006

Since I am running the code in an AWS Lambda environment, I did the following

  1. I added a openssl.cnf file(with contents from the reference link) to the root of the lambda-layer and
  2. Set NODE_OPTIONS environment variable with a value --openssl-config=/opt/nodejs/openssl.cnf

That solved the issue for me. Hope that helps

I wish got can provide a way to pass secureOptions: crypto.constants.SSL_OP_LEGACY_SERVER_CONNECT via https options like other libraries (ex axios etc) do.

vijay-koppala avatar Dec 08 '23 04:12 vijay-koppala