TLS/https provide alternate CA for server validation #1483
-
Hi, I've been using node-fetch for https requests but have recently had issues with request timeout detection/handling and so have been looking at undici as an alternative. I've done most the work with it but I need to have server certificate validation, i'm getting self signed cert in chain error, which is expected without my own CA. In node-fetch i did something like this provide my ca certificate:
I can't figure out how to do similar it in undici can anyone help. I've searched the docs and questions but there's nothing that looks obvious...or simple? I'm using |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
I think you could achieve this by passing a This is the relevant place where this is documented: https://undici.nodejs.org/#/docs/api/Client?id=parameter-connectoptions. |
Beta Was this translation helpful? Give feedback.
I think you could achieve this by passing a
connect
option to a customundici.Agent
, which is any option that can be passed through https://nodejs.org/api/tls.html#tls_tls_connect_options_callback.This is the relevant place where this is documented: https://undici.nodejs.org/#/docs/api/Client?id=parameter-connectoptions.
I understand this is not much. Maybe you would like to document this in our doc under the "best practices" label?