def test_tls_connect_disconnect(self):
        """Test with TLS or SSL endpoint.

        According to the deprecation note for the SSL client endpoint,
        the TLS endpoint is supported from Twistd 16.0.

        TODO add certificate verification (also will require some conditionals
        on various versions, including PyOpenSSL, service_identity. The CA used
        to generate the testing cert is in ``PKI_DIR/ca``
        """
        def escape_colon(path):
            # on windows we can't have \ as it serves as the escape character for :
            return path.replace('\\', '/').replace(':', '\\:')
        self.server_connection_string = (
            "ssl:port=0:certKey={pub}:privateKey={priv}:" +
            "interface=127.0.0.1").format(
                pub=escape_colon(os.path.join(PKI_DIR, '127.0.0.1.crt')),
                priv=escape_colon(os.path.join(PKI_DIR, '127.0.0.1.key')))
        self.client_connection_string_tpl = "ssl:host=127.0.0.1:port={port}"

        yield self.addWorker()

        # connect
        worker = yield self.connectWorker()

        # disconnect
        self.workerSideDisconnect(worker)

        # wait for the resulting detach
        yield worker.waitForDetach()