- Version: v6.10.0
- Platform: Windows 10 64-bit
When calling https.createServer({ }) with an empty opts argument, the listening event is emitted, however no port is bound. Also, no error is emitted/thrown.
However, if a value for the options pfx, path, or key given in opts is invalid/incorrect createServer will emit/throw an error is the correct behavior, which I assume is the correct behavior. As such, shouldn't an error be thrown for the case when no certificate is provided?
Example:
var https = require('https');
var server = https.createServer({ });
server.on('error', function(err){ console.log(err); });
server.on('listening', function(){ console.log("listening!"); });
server.listen(5000);
// => outputs listening!
When calling
https.createServer({ })with an emptyoptsargument, the listening event is emitted, however no port is bound. Also, no error is emitted/thrown.However, if a value for the options
pfx,path, orkeygiven inoptsis invalid/incorrectcreateServerwill emit/throw an error is the correct behavior, which I assume is the correct behavior. As such, shouldn't an error be thrown for the case when no certificate is provided?Example: