From fbeed194d248812b124d158e0c8e6dc454e1d1ab Mon Sep 17 00:00:00 2001 From: Pontus Melke Date: Thu, 23 Jun 2016 16:37:12 +0200 Subject: [PATCH] Slighly more robust tofu detection The checking of if platform supports trust-on-first-use is broken on node 6. We need a more robust way of detecting this, but until then this will have to do. --- src/v1/internal/features.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/v1/internal/features.js b/src/v1/internal/features.js index f442ab80c..ecd7f470c 100644 --- a/src/v1/internal/features.js +++ b/src/v1/internal/features.js @@ -26,8 +26,8 @@ const FEATURES = { // This is insane. We are verifying that we have a version of getPeerCertificate // that supports reading the whole certificate, eg this commit: // https://github.com/nodejs/node/commit/345c40b6 - let desc = require('tls').TLSSocket.prototype.getPeerCertificate.toString(); - return desc.startsWith("function getPeerCertificate(detailed)"); + let desc = require('tls').TLSSocket.prototype.getPeerCertificate; + return desc.length() >= 1; } catch( e ) { return false; }