@@ -70,7 +70,8 @@ const https = require('https');
70
70
const fs = require (' fs' );
71
71
72
72
const options = {
73
- pfx: fs .readFileSync (' server.pfx' )
73
+ pfx: fs .readFileSync (' test/fixtures/test_cert.pfx' ),
74
+ passphrase: ' sample'
74
75
};
75
76
76
77
https .createServer (options, (req , res ) => {
@@ -167,14 +168,14 @@ Example:
167
168
``` js
168
169
const https = require (' https' );
169
170
170
- var options = {
171
+ const options = {
171
172
hostname: ' encrypted.google.com' ,
172
173
port: 443 ,
173
174
path: ' /' ,
174
175
method: ' GET'
175
176
};
176
177
177
- var req = https .request (options, (res ) => {
178
+ const req = https .request (options, (res ) => {
178
179
console .log (' statusCode:' , res .statusCode );
179
180
console .log (' headers:' , res .headers );
180
181
@@ -191,7 +192,7 @@ req.end();
191
192
Example using options from [ ` tls.connect() ` ] [ ] :
192
193
193
194
``` js
194
- var options = {
195
+ const options = {
195
196
hostname: ' encrypted.google.com' ,
196
197
port: 443 ,
197
198
path: ' /' ,
@@ -201,8 +202,8 @@ var options = {
201
202
};
202
203
options .agent = new https.Agent (options);
203
204
204
- var req = https .request (options, (res ) => {
205
- ...
205
+ const req = https .request (options, (res ) => {
206
+ // ...
206
207
});
207
208
```
208
209
@@ -211,7 +212,7 @@ Alternatively, opt out of connection pooling by not using an `Agent`.
211
212
Example:
212
213
213
214
``` js
214
- var options = {
215
+ const options = {
215
216
hostname: ' encrypted.google.com' ,
216
217
port: 443 ,
217
218
path: ' /' ,
@@ -221,8 +222,8 @@ var options = {
221
222
agent: false
222
223
};
223
224
224
- var req = https .request (options, (res ) => {
225
- ...
225
+ const req = https .request (options, (res ) => {
226
+ // ...
226
227
});
227
228
```
228
229
0 commit comments