commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adrian Sutton <Adrian.Sut...@Ephox.com>
Subject RE: HTTPClient basic authentication against LinkSys router
Date Tue, 15 Jul 2003 01:54:28 GMT
The "192.168.1.1" part for some reason isn't matching the server name
correctly - I don't know why.

To find out why, I'll need a debug log with wire trace on and debug level
set.  See http://jakarta.apache.org/commons/httpclient/logging.html for
instructions.

It's very unlikely to be an incompatibility with the Linksys router by the
looks of it - rather something screwy going on with what hostname is being
used.  The wire log should reveal all. :)

Regards,

Adrian Sutton, Software Engineer
Ephox Corporation
www.ephox.com 

-----Original Message-----
From: Brad Clarke [mailto:bgclarke16@hotmail.com]
Sent: Tuesday, 15 July 2003 11:50 AM
To: commons-user@jakarta.apache.org
Subject: HTTPClient basic authentication against LinkSys router


I am migrating some code that was originally using Ronald Tschalär
HTTPClient code to the Apache commons HTTPClient (beta 2).

I have used the BasicAuthenticatonExample as the basis for my test.

The problem I am having is that if I use:

            client.getState().setCredentials("192.168.1.1",
               "Linksys BEFSR41/BEFSR11/BEFSRU31",
                new UsernamePasswordCredentials("user", "password"));
            GetMethod get = new GetMethod("http://192.168.1.1/Status.htm");
            get.setDoAuthentication( true );

I get a 401 error.

If I use the deprecated format:
            client.getState().setCredentials("Linksys
BEFSR41/BEFSR11/BEFSRU31",
                new UsernamePasswordCredentials("user", "password"));
            GetMethod get = new GetMethod("http://192.168.1.1/Status.htm");
            get.setDoAuthentication( true );

It works fine.

I've tried different forms of "192.168.1.1" in the setCredentials, but
nothing seems to work.

The LinkSys router does not have a true http server onboard, so I wonder if
that could be part of the problem.

Any ideas?

Thanks...Brad

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message