Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > What's the simplest way to write an HTTPS client in Java?

Reply
Thread Tools

What's the simplest way to write an HTTPS client in Java?

 
 
Simon
Guest
Posts: n/a
 
      11-28-2007
Hello -

I'm trying to write a simple Java client program that tries to establish a
connection with a webserver over HTTPS. The webserver requires 2-way
authentication, ie. the server authenticates itself to the server and
vice-versa. I have a client certificate in the form of a P7B file. The
server certificate is self-signed. I want to keep the client program as
simple as possible, as it will be used to debug contentious communications
issues.

Is it possible to do this simply using the HttpsURLConnection class? It
seems to have no way to import a certificate on the fly. It seems to require
the use of other classes such as KeyStore, which adds complexity and reduces
clarity.

Can anyone offer advice?


 
Reply With Quote
 
 
 
 
Manish Pandit
Guest
Posts: n/a
 
      11-28-2007
On Nov 28, 11:25 am, "Simon" <si...@dsdwerewrf.invalid.com> wrote:
> Hello -
>
> I'm trying to write a simple Java client program that tries to establish a
> connection with a webserver over HTTPS. The webserver requires 2-way
> authentication, ie. the server authenticates itself to the server and
> vice-versa. I have a client certificate in the form of a P7B file. The
> server certificate is self-signed. I want to keep the client program as
> simple as possible, as it will be used to debug contentious communications
> issues.
>
> Is it possible to do this simply using the HttpsURLConnection class? It
> seems to have no way to import a certificate on the fly. It seems to require
> the use of other classes such as KeyStore, which adds complexity and reduces
> clarity.
>
> Can anyone offer advice?


I have not used 2-way auth over HTTPS, but for 1-way I found Apache's
HTTPClient (http://jakarta.apache.org/httpcompon...ttpclient-3.x/
sslguide.html) to work very well. It might be worth a look..as it
could very well support 2-way auth.

-cheers,
Manish
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to write the simplest Windows program? Knut Olsen-Solberg C++ 6 02-20-2007 11:13 AM
Simplest way to do Python/Ajax with server and client on same machine? Kenneth McDonald Python 2 12-29-2006 08:00 PM
What's the simplest way to update an XML file? Alan Silver ASP .Net 4 08-10-2005 05:23 PM
What's the simplest way to do URL rewriting? Alan Silver ASP .Net 9 06-26-2005 02:16 PM
simplest way to password protect website with SQL Server Brent Burkart ASP .Net 5 10-16-2003 05:34 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57