× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Hi, Gary, your name was on some of the archive entries I already read. Here's 
what I am trying to do: I am trying to send a file to an HTTPS URL. I'm using 
Apache HttpClient to do this, and here's the Java code I wrote to do that:


HttpClient client = new HttpClient();
client.getHostConfiguration().setProxy(
                                System.getProperty("http.proxyHost"),
                                
Integer.parseInt(System.getProperty("http.proxyPort")));
PostMethod method = new PostMethod("https://xxxxxxxxxxxxxxxxx";);
int status = client.executeMethod(method);
InputStream response = method.getResponseBodyAsStream();


This is just code to test that the connection is being made, normally I would 
be attaching a file. I also have jcert.jar, jnet.jar, and jsse.jar in my 
classpath. (I get the same results if they aren't, but they are in the 
classpath for the production application.)

The client's certificate was issued by "Entrust.net Secure Server Certification 
Authority" and it hasn't expired yet.

I did a little more testing. On the machine where I set up a certificate 
authority I get the message "Certificate is not signed by a trusted certificate 
authority". On another machine where there is no certificate authority set up, 
I get the message "javax.net.ssl.SSLException: The value specified for the 
argument is not correct". (It doesn't say what argument.) The errors occur at 
the call to executeMethod().

Obviously I'm confused too. And obviously I'm not understanding this SSL 
business properly. I wouldn't have expected to have to do any setup on the 
client at all just to communicate to an HTTPS server, but initially when I 
tried I was getting errors that suggested to me that I needed some kind of 
certificate. (That was a month ago before another project took priority, and 
now I don't have my notes on what happened back then.)

Regards
PC2

-----Original Message-----
From: java400-l-bounces@xxxxxxxxxxxx [mailto:java400-l-bounces@xxxxxxxxxxxx] On 
Behalf Of Gary L Peskin
Sent: December 13, 2006 11:51
To: 'Java Programming on and around the iSeries / AS400'
Subject: RE: Java and HTTPS

I'm very confused here.  If you are sending a file to a business partner using 
HTTPS, normally your business partner will not require a client side 
certificate which is what you created.  In other words, you would connect to 
the HTTPS server, it would present its certificate, you would validate that and 
go from there.

Can you tell us exactly what you're trying to do?  How are you sending the 
file?  Is this via a homegrown java program or what?  Can you access the client 
via a web browser?  If so, you can examine the certificate presented by the 
server and see who his CA is and diagnose from there.

Gary


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.