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

node: Support passing Private Key and Cert Chain to https.Agent in http request #17746

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

nana4gonta
Copy link

@nana4gonta nana4gonta commented Feb 27, 2025

What does this PR do?

fixed: #16546

new https.Agent({}) now supports passing a Private Key (key) and Cert Chain (cert).

The ca.{crt,csr,key,srl}, {client, server}.{crt, csr, key} added to test/js/node/http/fixtures were generated using the following commands.

openssl genpkey -algorithm RSA -out ca.key
openssl req -new -key ca.key -out ca.csr -subj "/CN=root"
openssl x509 -req -days 36500 -in ca.csr -out ca.crt -signkey ca.key
echo "subjectAltName=DNS:localhost,IP:127.0.0.1" > san.txt

openssl genpkey -algorithm RSA -out client.key
openssl req -new -key client.key -out client.csr -subj "/CN=client"
openssl x509 -req -days 3650 -in client.csr -CA ca.crt -CAkey ca.key -CAcreateserial -out client.crt -extfile san.txt

openssl genpkey -algorithm RSA -out server.key
openssl req -new -key server.key -out server.csr -subj "/CN=localhost"
openssl x509 -req -days 3650 -in server.csr -CA ca.crt -CAkey ca.key -CAcreateserial -out server.crt -extfile san.txt 
  • [ ] Documentation or TypeScript types (it's okay to leave the rest blank in this case)
  • Code changes

How did you verify your code works?

  • I included a test for the new code, or existing tests cover it
  • I ran my tests locally and they pass (bun-debug test test-file-name.test)

@nana4gonta nana4gonta force-pushed the support-http-request-with-agent-key-cert branch 3 times, most recently from 508fc18 to cb2306b Compare February 27, 2025 05:00
@nana4gonta nana4gonta closed this Feb 27, 2025
@nana4gonta nana4gonta reopened this Feb 27, 2025
@nana4gonta nana4gonta force-pushed the support-http-request-with-agent-key-cert branch from cb2306b to f0ef8e2 Compare February 27, 2025 12:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support http requests using key, cert in https.Agent of node:https
1 participant