From: Kyle Nekritz Date: Thu, 21 Jan 2016 21:54:28 +0000 (-0800) Subject: Add getPeerCert() to AsyncTransport. X-Git-Tag: deprecate-dynamic-initializer~146 X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=312601107eb004986a021b71973f8ee0062021b5;p=folly.git Add getPeerCert() to AsyncTransport. Reviewed By: elindsey Differential Revision: D2850760 fb-gh-sync-id: 60dbc3117e658d2fd083a87884892924bf313019 --- 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 */