Skip to content

Commit 519a217

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 519a217

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/v1/internal/features.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const FEATURES = {
2727
// that supports reading the whole certificate, eg this commit:
2828
// https://github.com/nodejs/node/commit/345c40b6
2929
let desc = require('tls').TLSSocket.prototype.getPeerCertificate.toString();
30-
return desc.startsWith("function getPeerCertificate(detailed)");
30+
return desc.indexOf("function getPeerCertificate(detailed)") >= 0;
3131
} catch( e ) {
3232
return false;
3333
}

0 commit comments

Comments
 (0)