@@ -70,7 +70,8 @@ const https = require('https');
7070const fs = require (' fs' );
7171
7272const options = {
73- pfx: fs .readFileSync (' server.pfx' )
73+ pfx: fs .readFileSync (' test/fixtures/test_cert.pfx' ),
74+ passphrase: ' sample'
7475};
7576
7677https .createServer (options, (req , res ) => {
@@ -167,14 +168,14 @@ Example:
167168``` js
168169const https = require (' https' );
169170
170- var options = {
171+ const options = {
171172 hostname: ' encrypted.google.com' ,
172173 port: 443 ,
173174 path: ' /' ,
174175 method: ' GET'
175176};
176177
177- var req = https .request (options, (res ) => {
178+ const req = https .request (options, (res ) => {
178179 console .log (' statusCode:' , res .statusCode );
179180 console .log (' headers:' , res .headers );
180181
@@ -191,7 +192,7 @@ req.end();
191192Example using options from [ ` tls.connect() ` ] [ ] :
192193
193194``` js
194- var options = {
195+ const options = {
195196 hostname: ' encrypted.google.com' ,
196197 port: 443 ,
197198 path: ' /' ,
@@ -201,8 +202,8 @@ var options = {
201202};
202203options .agent = new https.Agent (options);
203204
204- var req = https .request (options, (res ) => {
205- ...
205+ const req = https .request (options, (res ) => {
206+ // ...
206207});
207208```
208209
@@ -211,7 +212,7 @@ Alternatively, opt out of connection pooling by not using an `Agent`.
211212Example:
212213
213214``` js
214- var options = {
215+ const options = {
215216 hostname: ' encrypted.google.com' ,
216217 port: 443 ,
217218 path: ' /' ,
@@ -221,8 +222,8 @@ var options = {
221222 agent: false
222223};
223224
224- var req = https .request (options, (res ) => {
225- ...
225+ const req = https .request (options, (res ) => {
226+ // ...
226227});
227228```
228229
0 commit comments