Node-fetch: Doesn't download intermediate certificates

Created on 4 Jul 2019  路  4Comments  路  Source: node-fetch/node-fetch

See https://github.com/nodejs/node/issues/16336

According to https://github.com/nodejs/node/issues/16336#issuecomment-338434788 intermediate certificate downloading is supposed to be implemented by clients, like browsers and node-fetch.

await fetch('https://incomplete-chain.badssl.com/');

throws an error, even though the page opens without errors in chrome.

Node-specific

Most helpful comment

@xxczaki node-fetch may be used in scenarios where you're not in control of the server. Which is my use-case and the reason to open this ticket.

All 4 comments

Thx for the report, it's likely we won't be working around a server config issue, so my suggestion:

  • There are best practice on how to serve intermediate certificate properly, if a server is not following best practice, the best approach would be to ask them to update it.

  • There are alternatives where you can cache this cert yourself and supply them through Agent option, see this Request issue for workarounds: https://github.com/request/request/issues/3106

  • In a crawler scenario, I agree there isn't an easy solution, you will have to build around node-fetch to prefetch certificate in order to accommodate this issue.

There are best practice on how to serve intermediate certificate properly, if a server is not following best practice, the best approach would be to ask them to update it.

Can you point me towards resources for this? Running into this exact issue at the moment with a service that I set up myself but can't find a starting point at the moment beyond You messed up your certs.

@xxczaki node-fetch may be used in scenarios where you're not in control of the server. Which is my use-case and the reason to open this ticket.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

theogravity picture theogravity  路  5Comments

githubnikola picture githubnikola  路  3Comments

wheresrhys picture wheresrhys  路  3Comments

bittlingmayer picture bittlingmayer  路  4Comments

caub picture caub  路  4Comments