@@ -69,7 +69,8 @@ const https = require('https'); |
69 | 69 | const fs = require('fs'); |
70 | 70 |
|
71 | 71 | const options = { |
72 | | - pfx: fs.readFileSync('server.pfx') |
| 72 | + pfx: fs.readFileSync('test/fixtures/test_cert.pfx'), |
| 73 | + passphrase: 'sample' |
73 | 74 | }; |
74 | 75 |
|
75 | 76 | https.createServer(options, (req, res) => { |
@@ -143,14 +144,14 @@ Example: |
143 | 144 | ```js |
144 | 145 | const https = require('https'); |
145 | 146 |
|
146 | | -var options = { |
| 147 | +const options = { |
147 | 148 | hostname: 'encrypted.google.com', |
148 | 149 | port: 443, |
149 | 150 | path: '/', |
150 | 151 | method: 'GET' |
151 | 152 | }; |
152 | 153 |
|
153 | | -var req = https.request(options, (res) => { |
| 154 | +const req = https.request(options, (res) => { |
154 | 155 | console.log('statusCode:', res.statusCode); |
155 | 156 | console.log('headers:', res.headers); |
156 | 157 |
|
@@ -218,7 +219,7 @@ In order to specify these options, use a custom [`Agent`][]. |
218 | 219 | Example: |
219 | 220 |
|
220 | 221 | ```js |
221 | | -var options = { |
| 222 | +const options = { |
222 | 223 | hostname: 'encrypted.google.com', |
223 | 224 | port: 443, |
224 | 225 | path: '/', |
@@ -228,8 +229,8 @@ var options = { |
228 | 229 | }; |
229 | 230 | options.agent = new https.Agent(options); |
230 | 231 |
|
231 | | -var req = https.request(options, (res) => { |
232 | | - ... |
| 232 | +const req = https.request(options, (res) => { |
| 233 | + // ... |
233 | 234 | }); |
234 | 235 | ``` |
235 | 236 |
|
@@ -238,7 +239,7 @@ Alternatively, opt out of connection pooling by not using an `Agent`. |
238 | 239 | Example: |
239 | 240 |
|
240 | 241 | ```js |
241 | | -var options = { |
| 242 | +const options = { |
242 | 243 | hostname: 'encrypted.google.com', |
243 | 244 | port: 443, |
244 | 245 | path: '/', |
@@ -248,8 +249,8 @@ var options = { |
248 | 249 | agent: false |
249 | 250 | }; |
250 | 251 |
|
251 | | -var req = https.request(options, (res) => { |
252 | | - ... |
| 252 | +const req = https.request(options, (res) => { |
| 253 | + // ... |
253 | 254 | }); |
254 | 255 | ``` |
255 | 256 |
|
|