doc: add esm examples to `node:https`
This PR adds the ESM
counterparts of the CJS
examples for the HTTPS documentation.
I've taken the liberty to include the instructions on how to create the private-key.pem
, certificate.pem
and test_cert.pfx
files following the example from HTTP/2 Server-side example
so that users can easily follow and test them.
I've also updated the last example that is using github.com
as the hostname
so that the pubkey256
and cert256
match the current correct values so that no error is prompted to the user.
Lastly, on that same last example, the variable res.headers['public-key-pins']
was returning undefined
so I changed it for one of the attributes that res.headers
is returning and updated the current output as expected.
Edit: I've removed that last console.log(res.headers['public-key-pins'])
as per @lpinca's review since HPKP is obsolete and GitHub no longer returns the header.
I've tested every single example and they all work/behave as expected.
Best regards!