def test_unwrap_existing_socket(self) -> None:
        """
        Validates we can break up the TLS layer
        A full request/response is sent over TLS, and later over plain text.
        """

        def shutdown_handler(listener: socket.socket) -> None:
            with (
                listener.accept()[0] as sock,
                self.server_context.wrap_socket(sock, server_side=True) as ssl_sock,
            ):
                request = consume_socket(ssl_sock)
                validate_request(request)
                ssl_sock.sendall(sample_response())

                with ssl_sock.unwrap() as unwrapped_sock:
                    request = consume_socket(unwrapped_sock)
                    validate_request(request)
                    unwrapped_sock.sendall(sample_response())

        self.start_dummy_server(shutdown_handler)
        with socket.create_connection((self.host, self.port)) as sock:
            ssock = SSLTransport(sock, self.client_context, server_hostname="localhost")

            # request/response over TLS.
            ssock.sendall(sample_request())
            response = consume_socket(ssock)
            validate_response(response)

            # request/response over plaintext after unwrap.
            ssock.unwrap()
            sock.sendall(sample_request())
            response = consume_socket(sock)
            validate_response(response)

        Validates we can break up the TLS layer
        A full request/response is sent over TLS, and later over plain text.
        
test/test_ssltransport.py