From 67e06d2c5022e82984b0c7e6651876b5b0e7410d Mon Sep 17 00:00:00 2001 From: zhao liwei Date: Thu, 17 Dec 2020 15:23:33 +0800 Subject: [PATCH] feat(security): treat negotiation succeed if server is old version (#694) --- src/runtime/security/client_negotiation.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/runtime/security/client_negotiation.cpp b/src/runtime/security/client_negotiation.cpp index 09d0ec5530..7aef0359c7 100644 --- a/src/runtime/security/client_negotiation.cpp +++ b/src/runtime/security/client_negotiation.cpp @@ -50,7 +50,15 @@ void client_negotiation::list_mechanisms() void client_negotiation::handle_response(error_code err, const negotiation_response &&response) { if (err != ERR_OK) { - fail_negotiation(); + // ERR_HANDLER_NOT_FOUND means server is old version, which doesn't support authentication + if (ERR_HANDLER_NOT_FOUND == err && !FLAGS_mandatory_auth) { + ddebug_f("{}: treat negotiation succeed because server is old version, which doesn't " + "support authentication", + _name); + succ_negotiation(); + } else { + fail_negotiation(); + } return; }