Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SSL error when setting host: header correctly #1780

Open
infinity0 opened this issue Oct 9, 2023 · 1 comment
Open

SSL error when setting host: header correctly #1780

infinity0 opened this issue Oct 9, 2023 · 1 comment
Labels

Comments

@infinity0
Copy link

Reproduction

Tested on both versions v2.7.0 and v3.3.2

$ node
Welcome to Node.js v18.13.0.
Type ".help" for more information.
> const fetch = require('node-fetch');
undefined
> await fetch("https://bing.com/translator", { headers: { host: 'bing.com' } });
Uncaught:
[FetchError: request to https://www.bing.com/translator?toWww=1&redig=82C61AC2378040D08D01A7A0D7B9A04F failed, reason: write EPROTO C04769CC1A7F0000:error:0A000438:SSL routines:ssl3_read_bytes:tlsv1 alert internal error:../ssl/record/rec_layer_s3.c:1586:SSL alert number 80
] {
  type: 'system',
  errno: 'EPROTO',
  code: 'EPROTO'
}

Your Environment

software version
node-fetch v2.7.0 and v3.3.2
node v18.13.0
npm irrelevant, packages are already installed, running node in a system environment without NPM
Operating System Debian GNU/Linux trixie/sid
@infinity0
Copy link
Author

The bug happens with bing.com because it tries to redirect to www.bing.com; it doesn't happen for domains that don't redirect, such as fanyi.baidu.com.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant