Skip to content
Closed
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Fix buffer type check
  • Loading branch information
djphoenix committed Sep 1, 2017
commit a3897801ee2c13ed3323e5ef9a5eadd66dc6252b
3 changes: 1 addition & 2 deletions lib/_tls_common.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,13 +163,12 @@ exports.createSecureContext = function createSecureContext(options, context) {
if (options.pfx) {
if (!crypto)
crypto = require('crypto');
const Buffer = require('buffer').Buffer;

if (Array.isArray(options.pfx)) {
for (i = 0; i < options.pfx.length; i++) {
const pfx = options.pfx[i];
let buf;
if (pfx.buffer instanceof Buffer) {
if (ArrayBuffer.isView(pfx.buffer)) {
buf = crypto._toBuf(pfx.buffer);
} else {
buf = crypto._toBuf(pfx);
Expand Down