Add getPeerCert() to AsyncTransport.
authorKyle Nekritz <knekritz@fb.com>
Thu, 21 Jan 2016 21:54:28 +0000 (13:54 -0800)
committerfacebook-github-bot-0 <folly-bot@fb.com>
Thu, 21 Jan 2016 23:20:59 +0000 (15:20 -0800)
Reviewed By: elindsey

Differential Revision: D2850760

fb-gh-sync-id: 60dbc3117e658d2fd083a87884892924bf313019

folly/io/async/AsyncSSLSocket.h
folly/io/async/AsyncTransport.h

index 2836544f5ad4f357f2cd6df57f497914410cab52..33a1d79e68a559a9679a65399e954af2709bd285 100644 (file)
@@ -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;
     }
index 515656b8bd63e27c97836f479d50493746af219a..5d9c1b77ed54ab4c71cdb525d27a10730586def7 100644 (file)
@@ -22,6 +22,7 @@
 #include <folly/io/async/DelayedDestruction.h>
 #include <folly/io/async/EventBase.h>
 #include <folly/io/async/AsyncSocketBase.h>
+#include <folly/io/async/OpenSSLPtrTypes.h>
 
 #include <openssl/ssl.h>
 
@@ -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
    */