Skip to content
Discussion options

You must be logged in to vote

This error occurs becuase the server you're connecting to uses unsafe legacy SSL renegotiation, which is disabled by default in newer Node.js versions for security reasons.

You can enable it using the https.secureOptions option with Got:

import https from 'https';
import got from 'got';

await got('https://example.com', {
	https: {
		secureOptions: https.constants.SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION
	}
});

For streams, it works the same way:

const stream = got.stream('https://example.com', {
	https: {
		secureOptions: https.constants.SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION
	}
});

Note that this re-enables unsafe legacy renegotiation, which has security implications. Ideally, the ser…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@vijay-koppala
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by sindresorhus
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants