def connectionMade(self):
    """ Sets up the data protocol before any data transfer occurs.

    This method sets up the protocol right after the connection has been established. It is responsible for calling a
    function that will wait and load the user's certificate after the TLS handshake has been performed.

    @note Because this method may be (and probably will be) called before the connection's TLS handshake is complete,
          it calls an additional function that periodically checks if the client's certificate is available and, once it
          is, returns it via a deferred. Any data that the user tries to pass to the connection before the TLS handshake
          has completed will be dropped.
    @return Returns a deferred that will be fired with the requested Session.
    """

    # Wait for the user's certificate and load the requested session
    tls_handshake_deferred = utilities.load_session_after_tls_handshake(self)
    tls_handshake_deferred.addCallback(self.perform_registrations)
    tls_handshake_deferred.addErrback(self._connection_setup_error)

    return tls_handshake_deferred