Skip to content

Commit fbeed19

Browse files
committed
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.
1 parent fa06ca1 commit fbeed19

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/v1/internal/features.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ const FEATURES = {
2626
// This is insane. We are verifying that we have a version of getPeerCertificate
2727
// that supports reading the whole certificate, eg this commit:
2828
// https://github.com/nodejs/node/commit/345c40b6
29-
let desc = require('tls').TLSSocket.prototype.getPeerCertificate.toString();
30-
return desc.startsWith("function getPeerCertificate(detailed)");
29+
let desc = require('tls').TLSSocket.prototype.getPeerCertificate;
30+
return desc.length() >= 1;
3131
} catch( e ) {
3232
return false;
3333
}

0 commit comments

Comments
 (0)