-
-
Notifications
You must be signed in to change notification settings - Fork 366
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
Support for SSL client certificate in Nodejs undici #549
Comments
|
I found this example that reportedly works: From what I can tell, that should work with Ky. I'm closing this issue as I don't think there is anything for us to do here. |
Hey, sorry to comment on a closed issue but I tried this using fetch: const response = await fetch(
`${domain}/request`,
{
method: "GET",
headers: {
Authorization: `Bearer ${token}`,
},
dispatcher: agent,
}
); And it works fine, but: const response = await ky
.get(`${domain}/request`, {
headers: {
Authorization: `Bearer ${token}`,
},
dispatcher: agent,
})
.json(); Won't work. It ignores the In both cases, for this to work with Typescript, the following is needed: import { Agent } from "undici";
declare global {
interface RequestInit {
dispatcher?: Agent | undefined;
}
} So it might be related to that. Is it possible to force a property to be passed down to fetch? |
My best guess would be that Ky is only passing Ky already has a mechanism designed to handle cases like this but it's error-prone and perhaps this case isn't being handled properly. |
I know this library is intended for use in browser & nodejs, but one of the strong use cases for using it in node is the massive performance boost the underlying undici has over the http module.
So given the benefit of using a library that utilizes undici, and that
ky
is currently the best wrapper for a more convenient use - I ask about a specific implementation for nodejs.Undici can utilize client certificates: https://github.com/nodejs/undici/blob/main/docs/best-practices/client-certificate.md
If I'm not mistaken, the implementation on
ky
side is to allow some way of passing thetls
details to theconnect
method (which is standardized, only thetls
parameters aren't)Is it possible?
The text was updated successfully, but these errors were encountered: