Ajax for Node.js and browsers (JS HTTP client). Maintained for @forwardemail, @ladjs, @spamscanner, @breejs, @cabinjs, and @lassjs.
Support `pfx` TLS option with new pfx() method.
https.request() supports the TLS options of tls.connect().
The [`pfx` option][pfx] is a string or Buffer containing the
private key, certificate, and CA certs of the client in
[PKCS #12 format][p12].
This change introduces the pfx() method for setting the `pfx` option.
The Agent is modified to also set pfx() when ca() and cert() are set.
The `cert.pfx` file is used in testing instead of the CA and certificate
files to make sure requests work correctly when presenting the PKCS #12
archive instead of its parts. Since the server is uses the same CA and
certificate fixtures, the content of `cert.pfx` is derived from these
files using the command:
openssl pkcs12 -export -out cert.pfx -inkey key.pem \
-in cert.pem -certfile ca.cert.pem
[pfx]: https://nodejs.org/dist/latest-v6.x/docs/api/tls.html#tls_tls_createsecurecontext_options
[p12]: https://en.wikipedia.org/wiki/PKCS_12 R
Reid Burke committed
64e9542c7c09a60c36b1eaee3fc36b3f94daf54c
Parent: 12d3881