Skip to content

Slighly more robust tofu detection #95

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 27, 2016

Conversation

pontusmelke
Copy link
Contributor

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.

@@ -27,7 +27,7 @@ const FEATURES = {
// 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)");
return desc.indexOf("function getPeerCertificate(detailed)") >= 0;
Copy link
Contributor

@kpdecker kpdecker Jun 24, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

require('tls').TLSSocket.prototype.getPeerCertificate.length >= 1 is going to be more efficient and less prone to breakages.

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.
@pontusmelke pontusmelke merged commit 1f43734 into neo4j:1.0 Jun 27, 2016
@pontusmelke pontusmelke deleted the 1.0-tofu-discover branch June 27, 2016 15:38
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;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's desc.length >= 1, it's a property not a function.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oops, thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants