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
6 changes: 3 additions & 3 deletions lib/_tls_common.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ exports.createSecureContext = function createSecureContext(options, context) {
// NOTE: It's important to add CA before the cert to be able to load
// cert's issuer in C++ code.
var ca = options.ca;
if (ca !== undefined) {
if (ca) {
if (Array.isArray(ca)) {
for (i = 0; i < ca.length; ++i) {
val = ca[i];
Expand All @@ -96,7 +96,7 @@ exports.createSecureContext = function createSecureContext(options, context) {
}

var cert = options.cert;
if (cert !== undefined) {
if (cert) {
if (Array.isArray(cert)) {
for (i = 0; i < cert.length; ++i) {
val = cert[i];
Expand All @@ -115,7 +115,7 @@ exports.createSecureContext = function createSecureContext(options, context) {
// which leads to the crash later on.
var key = options.key;
var passphrase = options.passphrase;
if (key !== undefined) {
if (key) {
if (Array.isArray(key)) {
for (i = 0; i < key.length; ++i) {
val = key[i];
Expand Down