def hint_to_endpoint(hint, reactor, update_status):
    """Return (endpoint, hostname), or a Deferred that fires with the
        same, where endpoint is an IStreamClientEndpoint object, and hostname
        is a string (for use in the HTTP headers during negotiation). The
        endpoint, once connected, must be capable of handling .startTLS().
        Hints are strings which always start with 'TYPE:', and handlers are
        registered for specific types (and will not be called with hints of
        other types). update_status() can be called (with a string) to report
        progress, and should typically be set just before waiting for some
        connections step (e.g. connecting to a Tor daemon). Raise
        InvalidHintError (or return a Deferred that errbacks with one) if the
        hint could not be parsed or otherwise turned into an Endpoint. Set an
        attribute named 'foolscap_connection_handler_error' on the exception
        object to have `ConnectionInfo.connectorStatuses()` report that
        string instead of an exception-class -based status message."""
