Skip to content

Commit 1f43734

Browse files
authored
Merge pull request #95 from pontusmelke/1.0-tofu-discover
Slighly more robust tofu detection
2 parents fa06ca1 + fbeed19 commit 1f43734

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)