June 2014
Intermediate to advanced
696 pages
38h 52m
English
Creating an HTTPS client is almost exactly like creating an HTTP client, discussed earlier in this chapter. The only difference is that there are additional options, shown in Table 7.9, that allow you to specify the security for the client. The most important options are key, cert, and agent.
Table 7.9 Additional options for https.request() and https.createServer()
The key option specifies the private key used for SSL. The cert value specifies the x509 public key to use. The global agent does not support options needed by HTTPS, so you need to disable the agent by setting the agent to null, as shown below:
Read now
Unlock full access