[
https://issues.apache.org/jira/browse/HTTPCLIENT-579?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12517227
]
V. K. commented on HTTPCLIENT-579:
----------------------------------
Hello Konstantin,
I am from Greece and I 've tried to use your code. I downloaded the source code
of HttpClient-3.0, I replaced the files NTLM.java, NTLMauth.java and
NTLMScheme.java with your own ones and I also added the files under the
org\apache\commons\httpclient\crypto package that you provided. After that, I
compiled all the files using jdk1.6.0_01 java platform and I used the following
code to call a web page (which I found as an example into the HttpClient-3.0
source code):
__________________________________________________________________________________
ProxyClient proxyclient = new ProxyClient();
// set the host the proxy should create a connection to
//
// Note: By default port 80 will be used. Some proxies only allow
conections
// to ports 443 and 8443. This is because the HTTP CONNECT method was
intented
// to be used for tunneling HTTPS.
proxyclient.getHostConfiguration().setHost("www.verisign.com", 443);
// set the proxy host and port
proxyclient.getHostConfiguration().setProxy("myproxy", 8080);
// set the proxy credentials, only necessary for authenticating proxies
proxyclient.getState().setProxyCredentials(
new AuthScope("myproxy", 8080, null),
new UsernamePasswordCredentials("myWindowsUsername",
"myWindowsPwd"));
// create the socket
ProxyClient.ConnectResponse response = proxyclient.connect();
if (response.getSocket() != null) {
Socket socket = response.getSocket();
try {
// go ahead and do an HTTP GET using the socket
Writer out = new OutputStreamWriter(
socket.getOutputStream(), "ISO-8859-1");
out.write("GET http://www.verisign.com/ HTTP/1.1\r\n");
out.write("Host: www.verisign.com\r\n");
out.write("Agent: whatever\r\n");
out.write("\r\n");
out.flush();
BufferedReader in = new BufferedReader(
new InputStreamReader(socket.getInputStream(),
"ISO-8859-1"));
String line = null;
while ((line = in.readLine()) != null) {
System.out.println(line);
}
} finally {
// be sure to close the socket when we're done
socket.close();
}
} else {
// the proxy connect was not successful, check connect method for
reasons why
System.out.println("Connect failed: " +
response.getConnectMethod().getStatusLine());
System.out.println(response.getConnectMethod().getResponseBodyAsString());
}
}
__________________________________________________________________________________
The problem is that I still receive the error 'Connect failed: HTTP/1.1 407
Proxy Authentication Required ( The ISA Server requires authorization to
fulfill the request. Access to the Web Proxy service is denied.' which is the
same one that I had when I used the initial HttpClient-3.0.
Could you please tell me which version of HttpClient did you use? There are
plenty of them starting from 2.0-beta1 till 4.0-alpha1. Moreover, in case you
noticed anything strange in the above code, could you please give me a sample
of java code that authenticates a user to a proxy server?
Thanks in advance for your reply,
Voula
> NTLMv2 support
> --------------
>
> Key: HTTPCLIENT-579
> URL: https://issues.apache.org/jira/browse/HTTPCLIENT-579
> Project: HttpComponents HttpClient
> Issue Type: Improvement
> Components: HttpAuth
> Affects Versions: 3.0 Final
> Environment: WIndows 2000 Pro SP4, JDK 1.4.2
> Reporter: Konstantin Kasatkin
> Fix For: 3.1 Alpha 1
>
> Attachments: NTLMv2.rar
>
>
> Hello guys,
> recently I've encouner the problem how to interact with HTTP resourses
> protected tough security policy allowed to use only NTLMv2 authorization
> scheme from a java application.
> Earlier I used httpclient to accomplish NTLMv1 authorization, but when I was
> requested to move to NTLMv2 I was surprised, that httpclient does not support
> this.
> I've dug all the Internet and found some articles and examples how to
> implement it, and finally having compiled all this enormous heap of
> information, I have a couple modified classes from httpclient project, that
> I'd like to share with you and other users of httpclient.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]