0

Let's say I have this simple code:

const https = require('https')

const agent = new https.Agent({ keepAlive: true })
const request = https
  .request({ agent, host: 'example.com' }, (response) => {
    response.pipe(process.stdout)
  })
  .end()

How do I modify it to retrieve which client and/or server certificate this code uses?
Or do I misunderstand how HTTPS works?

Wynell
  • 633
  • 1
  • 8
  • 15
  • What do you mean with: "client and/or server certificate this code uses" ? – Marc Mar 13 '22 at 22:05
  • @Marc 1. I heard I can do a request using my own certificate to make a request (https://stackoverflow.com/questions/15254976/how-do-i-use-the-node-js-request-module-to-make-an-ssl-call-with-my-own-certific) - is it just empty when I don't set it explicitly? – Wynell Mar 14 '22 at 15:30
  • @Marc 2. Retrieve website's certificate from node. I just found the answer so exactly this question doesn't need the answer here anymore – Wynell Mar 14 '22 at 15:31

0 Answers0