[gst-devel] [souphttpsrc] Proxy authentication not working

Ron McOuat rmcouat at smartt.com
Thu Oct 8 10:29:07 CEST 2009


I added both the direct and proxy authentication code which first 
appeared in 0.10.14, prior to this the element had no capability for 
authentication. It is a thin layer over the soup library in Gnome. When 
I was using the element I tried to get basic authentication working to a 
network camera by supplying credentials inline on the URL as 
http://user:pass@address but these were ignored by the soup library so 
the user-id user-pw parameters were added to the element using the 
SoupSession "authenticate" signal. In a similar way the proxy-id and 
proxy-pw were put in but tested to a lesser extent. The soup library 
does most of the work, all that was needed in the gst element is a 
simple callback as follows plus a line to register the callback

static void
gst_soup_http_src_authenticate_cb (SoupSession *session, SoupMessage *msg,
    SoupAuth *auth, gboolean retrying, GstSoupHTTPSrc *src)
{
  if (! retrying) {
    /* First time authentication only, if we fail and are called again 
with retry true fall through */
    if (msg->status_code == SOUP_STATUS_UNAUTHORIZED) {
      soup_auth_authenticate (auth, src->user_id, src->user_pw);
    }
    else if (msg->status_code == 
SOUP_STATUS_PROXY_AUTHENTICATION_REQUIRED) {
      soup_auth_authenticate (auth, src->proxy_id, src->proxy_pw);
    }
  }
}

The callback does not process the request if the retrying parameter is 
true because the user id and password are supplied as properties during 
element initialization and not by user input  from a GUI so the answer 
will always be the same resulting in an endless loop.

Just to ask the obvious the proxy user and password you are using is 
correct?

Could you make a URL available to me for testing, the difficulty 
probably is the proxy is inside your firewall.

Ron


Thomas Loewe wrote:
> Hi,
>
> i'm trying to implement proxy support to my application, but it looks like
> the auth doesn't work with souphttpsrc 0.10.16.
>
> I've tried gst-launch with the "proxy-id=user" / "proxy-pw=pass" and the
> "http:\\user:pass at proxy" too, but booth of them returns "407 Proxy
> Authentication Required".
>
> Is this a known bug or do i something wrong?
>
> Thank you,
> Thomas
>   




More information about the gstreamer-devel mailing list