Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 10 additions & 9 deletions doc/api/https.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ const https = require('https');
const fs = require('fs');

const options = {
pfx: fs.readFileSync('server.pfx')
pfx: fs.readFileSync('test/fixtures/test_cert.pfx'),
passphrase: 'sample'
};

https.createServer(options, (req, res) => {
Expand Down Expand Up @@ -167,14 +168,14 @@ Example:
```js
const https = require('https');

var options = {
const options = {
hostname: 'encrypted.google.com',
port: 443,
path: '/',
method: 'GET'
};

var req = https.request(options, (res) => {
const req = https.request(options, (res) => {
console.log('statusCode:', res.statusCode);
console.log('headers:', res.headers);

Expand All @@ -191,7 +192,7 @@ req.end();
Example using options from [`tls.connect()`][]:

```js
var options = {
const options = {
hostname: 'encrypted.google.com',
port: 443,
path: '/',
Expand All @@ -201,8 +202,8 @@ var options = {
};
options.agent = new https.Agent(options);

var req = https.request(options, (res) => {
...
const req = https.request(options, (res) => {
// ...
});
```

Expand All @@ -211,7 +212,7 @@ Alternatively, opt out of connection pooling by not using an `Agent`.
Example:

```js
var options = {
const options = {
hostname: 'encrypted.google.com',
port: 443,
path: '/',
Expand All @@ -221,8 +222,8 @@ var options = {
agent: false
};

var req = https.request(options, (res) => {
...
const req = https.request(options, (res) => {
// ...
});
```

Expand Down