From 4ff438f88567303e6c3766274895f9f07b546c3c Mon Sep 17 00:00:00 2001 From: Neel Goyal Date: Thu, 17 Aug 2017 10:59:06 -0700 Subject: [PATCH] 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 --- folly/io/async/AsyncSSLSocket.h | 3 +++ 1 file changed, 3 insertions(+) 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"; } -- 2.34.1