From 7fc28369b5a20aafa175944e50a0eaf3218f352b Mon Sep 17 00:00:00 2001 From: Neel Goyal Date: Tue, 8 Dec 2015 05:18:02 -0800 Subject: [PATCH] Mark some methods virtual on SSL Context. Summary: Mark some methods as virtual. This makes writing some better unit tests on the associated task possible. Reviewed By: siyengar Differential Revision: D2730126 fb-gh-sync-id: f79f7632e873cb218bb49883d9b53beea7bb96e7 --- folly/io/async/AsyncSSLSocket.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/folly/io/async/AsyncSSLSocket.h b/folly/io/async/AsyncSSLSocket.h index a0b96a08..5d8a0e6b 100644 --- a/folly/io/async/AsyncSSLSocket.h +++ b/folly/io/async/AsyncSSLSocket.h @@ -409,7 +409,7 @@ class AsyncSSLSocket : public virtual AsyncSocket { * Determine if the session specified during setSSLSession was reused * or if the server rejected it and issued a new session. */ - bool getSSLSessionReused() const; + virtual bool getSSLSessionReused() const; /** * true if the session was resumed using session ID @@ -425,7 +425,7 @@ class AsyncSSLSocket : public virtual AsyncSocket { * Returns the cipher used or the constant value "NONE" when no SSL session * has been established. */ - const char *getNegotiatedCipherName() const; + virtual const char* getNegotiatedCipherName() const; /** * Get the server name for this SSL connection. @@ -712,7 +712,7 @@ class AsyncSSLSocket : public virtual AsyncSocket { /** * Returns the time taken to complete a handshake. */ - std::chrono::nanoseconds getHandshakeTime() const { + virtual std::chrono::nanoseconds getHandshakeTime() const { return handshakeEndTime_ - handshakeStartTime_; } @@ -729,7 +729,7 @@ class AsyncSSLSocket : public virtual AsyncSocket { /** * Returns the peer certificate, or nullptr if no peer certificate received. */ - std::unique_ptr getPeerCert() const { + virtual std::unique_ptr getPeerCert() const { if (!ssl_) { return nullptr; } -- 2.34.1