From 312601107eb004986a021b71973f8ee0062021b5 Mon Sep 17 00:00:00 2001 From: Kyle Nekritz Date: Thu, 21 Jan 2016 13:54:28 -0800 Subject: [PATCH] Add getPeerCert() to AsyncTransport. Reviewed By: elindsey Differential Revision: D2850760 fb-gh-sync-id: 60dbc3117e658d2fd083a87884892924bf313019 --- folly/io/async/AsyncSSLSocket.h | 2 +- folly/io/async/AsyncTransport.h | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/folly/io/async/AsyncSSLSocket.h b/folly/io/async/AsyncSSLSocket.h index 2836544f..33a1d79e 100644 --- a/folly/io/async/AsyncSSLSocket.h +++ b/folly/io/async/AsyncSSLSocket.h @@ -740,7 +740,7 @@ class AsyncSSLSocket : public virtual AsyncSocket { /** * Returns the peer certificate, or nullptr if no peer certificate received. */ - virtual X509_UniquePtr getPeerCert() const { + virtual X509_UniquePtr getPeerCert() const override { if (!ssl_) { return nullptr; } diff --git a/folly/io/async/AsyncTransport.h b/folly/io/async/AsyncTransport.h index 515656b8..5d9c1b77 100644 --- a/folly/io/async/AsyncTransport.h +++ b/folly/io/async/AsyncTransport.h @@ -22,6 +22,7 @@ #include #include #include +#include #include @@ -320,6 +321,11 @@ class AsyncTransport : public DelayedDestruction, public AsyncSocketBase { */ virtual void getPeerAddress(SocketAddress* address) const = 0; + /** + * Get the certificate used to authenticate the peer. + */ + virtual X509_UniquePtr getPeerCert() const { return nullptr; } + /** * @return True iff end of record tracking is enabled */ -- 2.34.1