• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

Certification problems

 
Ranch Hand
Posts: 105
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Hi,

I'm working on a Tomcat installation that accesses various web services. I added an interface into a new web service using axis.

the code I used to add certification for that web service was like so:


System.setProperty("javax.net.ssl.trustStore",CERTIFICATE_STORE_FILENAME);

which works, but it stops all the other web services from authenticating.

However, all the other web services dont use the trustStore.

they generally do something like this:

KeyStore ks = KeyStore.getInstance("PKCS12", "SunJSSE");
ks.load(new FileInputStream(cert_name), cert_password.toCharArray());
KeyManagerFactory kmf = KeyManagerFactory.getInstance("SunX509");

kmf.init(ks, cert_password.toCharArray());
SSLContext sslc = SSLContext.getInstance("SSLv3");
sslc.init(kmf.getKeyManagers(), null, null);
SSLSocketFactory ssf = sslc.getSocketFactory();

which use the keystore. I was under the impression that the trustStore and the keyStore were seperate, and wouldn't interfere with each other.

How can I resolve this?

John



 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
John if my understanding is correct.

You are creating a web service and deployed the same in axis in tomcat. Right?
You can use the tomcat/conf/server.xml file to refer the keystore file.
<Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"
maxThreads="150" scheme="https" secure="true"
clientAuth="false" sslProtocol="TLS" keyAlias="myKey" keystoreFile="keystore.ks" keypass="tomcat"/>

And at client side, you can use set the following:
System.setProperty("javax.net.ssl.trustStore", url.getPath());
System.setProperty("javax.net.ssl.trustStorePassword", "changeit");

Use your service with HTTPs and rest of the services on HTTP.




 
John Farrel
Ranch Hand
Posts: 105
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Alok,

No, I am not creating a web service. I have an application that is a client for many external web services.

For one client web service call, creating a keystore from one certificate and setting the keystore property stops all the other client web service calls from succeeding.

How can I use one service with HTTPs and the others with HTTP? The others are SSL as well.

 
Do not threaten THIS beaver! Not even with this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic