I am responding to myself :) I've just found out that I don't need the patch. Even better. Just implement HostnameVerifier and call HttpsURLConnection.setDefualtHostnameVerifier() in the client code.
- Steve Ko On Wed, 6 Aug 2003, Steven Ko wrote: > Here is how I get it working, but I am not sure if this is a viable > approach because I ended up modifying org.apache.xmlrpc.XmlRpcClient class > a little. My example & how to run it are very similar to a previous > posting by Martin Redington, > > http://www.mail-archive.com/[EMAIL PROTECTED]/msg00480.html > > The modification to XmlRpcClient class is from, > > http://saloon.javaranch.com/cgi-bin/ubb/ultimatebb.cgi?ubb=get_topic&f=7&t=007870 > > I needed to implement HostnameVerifier although I didn't want > to....SecureXmlRpcClient didn't work for some reason without the > modification. > > A Server example is here; > http://www.students.uiuc.edu/~sko/xmlrpc/SecureServer.java > > A Client example is here; > http://www.students.uiuc.edu/~sko/xmlrpc/SecureClient.java > > The patch is here; > http://www.students.uiuc.edu/~sko/xmlrpc/xmlrpc-1.1-XmlRpcClient.patch > > In order to test it, you need to creat keystores and a truststore. > Basically, you can follow JSSE reference guide; > > http://java.sun.com/j2se/1.4.2/docs/guide/security/jsse/JSSERefGuide.html#CreateKeystore > > Here is what I did; > > % keytool -genkey -alias server -keyalg RSA -validity 7 -keystore keystore > > Enter keystore password: server > ...(follow the guide) > > % keytool -export -alias server -keystore keystore -rfc -file server.cer > > Enter keystore password: server > ... > > % keytool -import -alias servercert -file server.cer -keystore truststore > > Enter keystore password: trustword > ... > > % keytool -genkey -alias client -keyalg RSA -validity 7 -keystore > client_keystore > > Enter keystore password: client > ... > > These steps will creat keystore, truststore, server.cer, > and client_keystore. These files should be in your directory with *.class > files. Put xmlrpc-1.1.jar in your classpath, then it would work. My xmlrpc > version is 1.1 and java version is 1.4.0. Again, any comments will be > appreciated. > > - Steve Ko > >
