-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
https: throw Error if required params missing
Throw an error when required parameters are missing. Handles ciphers that requires no auth. Does not throw error If pfx option is provided. Additional tests added for the same. Fixes: #3024 PR-URL: #3064
- Loading branch information
1 parent
017fc5b
commit fae020e
Showing
3 changed files
with
54 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
'use strict'; | ||
const common = require('../common'); | ||
const assert = require('assert'); | ||
const https = require('https'); | ||
const fs = require('fs'); | ||
|
||
const options1 = { | ||
key: fs.readFileSync(common.fixturesDir + '/keys/agent1-key.pem', 'ascii'), | ||
crt: fs.readFileSync(common.fixturesDir + '/keys/agent1-cert.pem', 'ascii') | ||
}; | ||
|
||
const options2 = { | ||
ky: fs.readFileSync(common.fixturesDir + '/keys/agent1-key.pem', 'ascii'), | ||
cert: fs.readFileSync(common.fixturesDir + '/keys/agent1-cert.pem', 'ascii') | ||
}; | ||
|
||
assert.throws(() => https.createServer(options1, assert.fail), | ||
'cert is a required parameter for Server.createServer'); | ||
|
||
assert.throws(() => https.createServer(options2, assert.fail), | ||
'key is a required parameter for Server.createServer'); |