We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c706b93 commit 097917cCopy full SHA for 097917c
lib/handshake.js
@@ -58,12 +58,15 @@ function hexlify (input) {
58
59
module.exports = function auth (stream, opts, cb) {
60
// filter used to make a copy so we don't accidently change opts data
61
- let authMethods;
62
- if (opts.authMethods) {
63
- authMethods = opts.authMethods;
64
- } else {
+ let authMethods = opts.authMethods;
+ if (opts.authMethods === undefined) {
65
authMethods = constants.defaultAuthMethods;
66
}
+ const skipAuthentication = authMethods.length === 0;
+ if (skipAuthentication) {
67
+ stream.once('readable', () => { cb(null, null); });
68
+ return;
69
+ }
70
stream.write('\0');
71
tryAuth(stream, authMethods.slice(), cb);
72
};
0 commit comments