HTTPS connection

Hi,

I am trying to make an HTTPS connection to one URL, and actually being connected to an associated homepage. I would suspect some kind of URL redirection, except that when I try to connect manually, I get in. Does anyone have an explanation for this? The relevant code is:

URL url = new URL("https://..."); // URL is complete and what I want

InetAddress addr = InetAddress.getLocalHost();

ClientHttpRequest req = new ClientHttpRequest(url);

req.setParameter("test", credentialFile);

InputStream is = req.post();

BufferedReader rd = new BufferedReader(new

InputStreamReader(is));

String line;

while ((line = rd.readLine()) != null) {

System.out.println(line);

}

rd.close();

and the constructor for req is:

public ClientHttpRequest(URL url) throws IOException {

this(url.openConnection());

}

Thanks in advance for any help you might offer.

[957 byte] By [Turennea] at [2007-11-27 6:29:49]
# 1
So ClientHttpRequest.post() is not relevant code? Are you reading any cookies returned from the server? Are your certificates ok?
Mr.E.H.a at 2007-7-12 17:54:03 > top of Java-index,Java Essentials,Java Programming...
# 2

Hi,

InputStream is = req.post();

Is the post method call.ClientHttpRequest's post method returns an input strean, which I use to read what is returned from. Do I have to include the name of the form {or anything else} in the post method call?

The Url is a cgi a cgi, by the way:

https://testserver/cgi-bin/pub/pki?cmd=pkcs10_req

Note also that I am trying to send a file, actually, which the form expects to be of input type file and named upload. I've gone to a three element setParameter call:

req.setParameter("upload", credentialFile.getAbsolutePath(), is1);

which has not helped.

Turennea at 2007-7-12 17:54:04 > top of Java-index,Java Essentials,Java Programming...