How to fix Sandbox bluesnap unsafe legacy renegotiation disabled error when using node.js 17

Viewed 1799

Node 17 (all versions) return the following error:

https://sandbox.bluesnap.com/services/2/payment-fields-tokens failed, reason: write EPROTO 00DE371301000000:error:0A000152:SSL routines:final_renegotiate:unsafe legacy renegotiation disabled

I don't have the same issue when using Node 16.

I tried setting

    fetch( // node-fetch
      'https://sandbox.bluesnap.com/services/2/payment-fields-tokens',
      {
        agent: new https.Agent({ // fix attempt
          rejectUnauthorized: false,
        }),
        body, // defined somewhere else
      }
    );

I also set NODE_TLS_REJECT_UNAUTHORIZED=0 in my .env file

and NODE_OPTIONS=--openssl-legacy-provider

and the same issue happens

I know this is probably a problem with bluesnap but a workaround would help while they resolve their issues and I can keep using the latest node version

1 Answers

If you're using nvm try running this command from the root directory:

nvm install --lts
Related