Hi!
I'm using httpClient for quite some time now, always with bouncycastle
and no problems so far.
But I met an issue that I can't handle. When trying to authenticate
NTLM, in a Windows 2000 mixed network, to a proxy, I have an exception
that I can't seem to correct.
The exception occur when I'm calling "client.executeMethod(httppost);"
and is as follow in the html in annex.
Can someone help me out? The code till the line where the exception
occurs follow after the signature.
Best regards,
Ivan Nobre Vereiski
Scopus Tecnologia Ltda.
Innovation Lab
[EMAIL PROTECTED]
Tel.: 55 11 3909-3552
Fax: 55 11 0000-0000
www.scopus.com.br
public byte[] post(String urlstring, byte[] request, String[]
header) throws OCSPQueryException {
HttpClient client = new HttpClient();
PostMethod httppost = new PostMethod();
try {
ProxySettings proxy = ProxySettings.getInstance();
Credentials cred = new NTCredentials(
proxy.getUser(),
//string username
proxy.getPassword(), //string password
proxy.getMachineName(), //string machine name like
"machine.domain.com.br"
proxy.getDomain()); //string domain name like "domain.com.br"
client.getState().setProxyCredentials(new AuthScope(
null, 80, null), cred);
client.getHostConfiguration().setProxy(proxy.getProxyServer(),
proxy.getProxyPort());
httppost.setDoAuthentication( true );
// Provide custom retry handler is necessary
DefaultMethodRetryHandler retryhandler = new
DefaultMethodRetryHandler();
retryhandler.setRequestSentRetryEnabled(false);
retryhandler.setRetryCount(3);
httppost.setMethodRetryHandler(retryhandler);
} catch (Exception e) {
//Just for debug
System.out.println("E: " + e);
}
try {
URI uri = new URI(urlstring, true);
httppost.setURI(uri);
httppost.setRequestHeader("Content-Type","application/ocsp-request");
httppost.setRequestHeader("Connection","Keep-Alive");
httppost.setRequestEntity(new
InputStreamRequestEntity(new ByteArrayInputStream(request)));
} catch (Exception e) {
//Just for debug
System.out.println("E: " + e);
}
try {
client.executeMethod(httppost);
AVISO LEGAL:
Esta mensagem e destinada exclusivamente para a(s) pessoa(s) a quem e
dirigida,podendo conter informacao confidencial e/ou legalmente privilegiada.
Se voce nao for destinatario desta mensagem, desde ja fica notificado de
abster-se a divulgar, copiar,distribuir, examinar ou, de qualquer forma,
utilizar a informacao contida nesta mensagem,por ser ilegal. Caso voce tenha
recebido esta mensagem por engano, pedimos que nos retorne este E-Mail,
promovendo, desde logo, a eliminacao do seu conteudo em sua base de dados,
registros ou sistema de controle. Fica desprovida de eficacia e validade a
mensagem que contiver vinculos obrigacionais, expedida por quem nao detenha
poderes de representacao.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]