1

I am getting following error when trying to make an API call to the vendor server. The issue I am facing is my code works when using node version 16 and following error is encountered when using node version 18.

C:\Users\project\node_modules\node-fetch\lib\index.js:1505
                        reject(new FetchError(`request to ${request.url} failed, reason: ${err.message}`, 'system', err));
                               ^
FetchError: request to https://test.server.com/GatewayAPI/rest failed, reason: write EPROTO D48F0000:error:0A000152:SSL routines:final_renegotiate:unsafe legacy renegotiation disabled:c:\users\openssl\ssl\statem\extensions.c:922:
    at ClientRequest.<anonymous> (C:\Users\project\node_modules\node-fetch\lib\index.js:1505:11)
    at ClientRequest.emit (node:events:513:28)
    at ClientRequest.emit (node:domain:489:12)
    at TLSSocket.socketErrorListener (node:_http_client:502:9)
    at TLSSocket.emit (node:events:513:28)
    at TLSSocket.emit (node:domain:489:12)
    at emitErrorNT (node:internal/streams/destroy:151:8)
    at emitErrorCloseNT (node:internal/streams/destroy:116:3)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
  type: 'system',
  errno: 'EPROTO',
  code: 'EPROTO'
}

I managed to fix this using the following- (Allow Legacy Renegotiation for NodeJs) It works with node version 18.

My question here is how it works on version 16 bydefault and not on version 18? Are there any pitfalls of using the openssl.cnf from this. (Allow Legacy Renegotiation for NodeJs)

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129

0 Answers0