On Thu, 15 Aug 2002, Gardner Monte wrote:

> I have a Servlet which needs to communicate with another servlet which
> will probably be on another server somewhere.  The data communicated
> needs to be secured in some way so that the bad guys can't read it :)
> We're thinking that using a https connection will be the most
> convenient way, but when I try to connect using the following code in
> the connecting servlet:
>
> URL url = new URL("https://sirius:8443/docutrax/ConverterServlet";);
> URLConnection con = url.openConnection();
>
> con.setUseCaches(false);
> con.setRequestProperty("CONTENT_TYPE", "application/octet-stream");
> con.setDoInput(true);
> con.setDoOutput(true);
> ObjectoutputStream dataOut = new ObjectOutputStream(con.getOutputStream());
>
> the last line throws an exception:
> java.net.ssl.sslException unrecognized SSL handshake
>
> I think this is because the servlet itself doesn't have access to
> whatever encryption keys or SSL stuff that a normal  browser would
> use to initiate such a connection.  Is there a way to connect to a
> servlet from a servlet over https, or would I be better of going
> for some other encryption technique such as the 3rd party software
> we are considering using?

You should be able to do this without any third party stuff, you just
need the JSSE stuff.  I think it may even come with more recent
versions of the JDK/J2SE.  I can't tell you how to set it up, I've
never tried it myself, but I am 99.99% positive it can be done.

And I'm sure this has come up before, so you might also check the
archives.

Milt Epstein
Research Programmer
Systems and Technology Services (STS)
Campus Information Technologies and Educational Services (CITES)
University of Illinois at Urbana-Champaign (UIUC)
[EMAIL PROTECTED]

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to