From: Neel Goyal Date: Thu, 17 Aug 2017 17:59:06 +0000 (-0700) Subject: Change AsyncSSLSocket getSecurityProtocol to handle unencrypted mode X-Git-Tag: v2017.08.21.00~7 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=4ff438f88567303e6c3766274895f9f07b546c3c;p=folly.git Change AsyncSSLSocket getSecurityProtocol to handle unencrypted mode Summary: Return empty string for `getSecurityProtocol` if the socket is good and the handshake failed, otherwise "TLS" Reviewed By: knekritz Differential Revision: D5647637 fbshipit-source-id: b95cbf39e4bb7f89b1ebcbc0238c2becba7ad42a --- diff --git a/folly/io/async/AsyncSSLSocket.h b/folly/io/async/AsyncSSLSocket.h index 044155dc..84551d77 100644 --- a/folly/io/async/AsyncSSLSocket.h +++ b/folly/io/async/AsyncSSLSocket.h @@ -282,6 +282,9 @@ class AsyncSSLSocket : public virtual AsyncSocket { std::string getApplicationProtocol() noexcept override; std::string getSecurityProtocol() const override { + if (sslState_ == STATE_UNENCRYPTED) { + return ""; + } return "TLS"; }