D
Deno

help

HTTPS custom cert passphrase in Deno?

Aabi5/9/2023
I have this code from a Node.js project, and I'm trying to figure out if there's any alternative in Deno today:
const config = {
method: "post",
baseURL: BASE_URL,
url: "/foobar",
data,
httpsAgent: new Agent({
ca: ca,
key: key,
passphrase: secret, // does this exist in deno?
cert: key,
secureProtocol: "TLSv1_2_method",
rejectUnauthorized: true,
requestCert: true,
}),
};
const config = {
method: "post",
baseURL: BASE_URL,
url: "/foobar",
data,
httpsAgent: new Agent({
ca: ca,
key: key,
passphrase: secret, // does this exist in deno?
cert: key,
secureProtocol: "TLSv1_2_method",
rejectUnauthorized: true,
requestCert: true,
}),
};
Using Deno.createHttpClient, I can do the following, but I can't find anything about a passphrase:
Deno.createHttpClient({
caCerts: [ca],
privateKey: key,
certChain: "...",
})
Deno.createHttpClient({
caCerts: [ca],
privateKey: key,
certChain: "...",
})

Looking for more? Join the community!