proxygen
folly::AsyncSSLSocket::HandshakeCB Class Referenceabstract

#include <AsyncSSLSocket.h>

Inheritance diagram for folly::AsyncSSLSocket::HandshakeCB:
BogoTestServer folly::AlpnClient folly::AlpnServer folly::BlockingWriteClient folly::BlockingWriteServer folly::HandshakeCallback folly::RenegotiatingServer folly::SNIClient folly::SNIServer folly::SSLHandshakeBase SSLCacheClient wangle::FizzAcceptorHandshakeHelper wangle::SSLAcceptorHandshakeHelper

Public Member Functions

virtual ~HandshakeCB ()=default
 
virtual bool handshakeVer (AsyncSSLSocket *, bool preverifyOk, X509_STORE_CTX *) noexcept
 
virtual void handshakeSuc (AsyncSSLSocket *sock) noexcept=0
 
virtual void handshakeErr (AsyncSSLSocket *sock, const AsyncSocketException &ex) noexcept=0
 

Detailed Description

Definition at line 75 of file AsyncSSLSocket.h.

Constructor & Destructor Documentation

virtual folly::AsyncSSLSocket::HandshakeCB::~HandshakeCB ( )
virtualdefault

Member Function Documentation

virtual void folly::AsyncSSLSocket::HandshakeCB::handshakeErr ( AsyncSSLSocket sock,
const AsyncSocketException ex 
)
pure virtualnoexcept

handshakeErr() is called if an error occurs while establishing the SSL connection.

The HandshakeCB will be uninstalled before handshakeErr() is called.

Parameters
sockSSL socket on which the handshake was initiated
exAn exception representing the error.

Implemented in folly::SSLHandshakeBase, folly::SNIServer, folly::SNIClient, folly::RenegotiatingServer, folly::AlpnServer, folly::AlpnClient, folly::BlockingWriteServer, folly::BlockingWriteClient, folly::HandshakeCallback, BogoTestServer, wangle::FizzAcceptorHandshakeHelper, SSLCacheClient, and wangle::SSLAcceptorHandshakeHelper.

Referenced by handshakeVer(), and folly::AsyncSSLSocket::invokeHandshakeErr().

virtual void folly::AsyncSSLSocket::HandshakeCB::handshakeSuc ( AsyncSSLSocket sock)
pure virtualnoexcept

handshakeSuc() is called when a new SSL connection is established, i.e., after SSL_accept/connect() returns successfully.

The HandshakeCB will be uninstalled before handshakeSuc() is called.

Parameters
sockSSL socket on which the handshake was initiated

Implemented in folly::SSLHandshakeServerParseClientHello, folly::SSLHandshakeBase, folly::SNIServer, folly::SNIClient, folly::RenegotiatingServer, folly::AlpnServer, folly::AlpnClient, folly::BlockingWriteServer, folly::BlockingWriteClient, folly::HandshakeCallback, BogoTestServer, wangle::FizzAcceptorHandshakeHelper, SSLCacheClient, and wangle::SSLAcceptorHandshakeHelper.

Referenced by handshakeVer(), and folly::AsyncSSLSocket::invokeHandshakeCB().

virtual bool folly::AsyncSSLSocket::HandshakeCB::handshakeVer ( AsyncSSLSocket ,
bool  preverifyOk,
X509_STORE_CTX *   
)
inlinevirtualnoexcept

handshakeVer() is invoked during handshaking to give the application chance to validate it's peer's certificate.

Note that OpenSSL performs only rudimentary internal consistency verification checks by itself. Any other validation like whether or not the certificate was issued by a trusted CA. The default implementation of this callback mimics what what OpenSSL does internally if SSL_VERIFY_PEER is set with no verification callback.

See the passages on verify_callback in SSL_CTX_set_verify(3) for more details.

Reimplemented in folly::SSLHandshakeBase.

Definition at line 93 of file AsyncSSLSocket.h.

References handshakeErr(), handshakeSuc(), and folly::pushmi::__adl::noexcept().

96  {
97  return preverifyOk;
98  }

The documentation for this class was generated from the following file: