0 Replies Latest reply on Apr 1, 2005 4:45 AM by Anders Hedstrom

    Where should I put my truststore?

    Anders Hedstrom Novice

      Hi,

      I have an SLSB that consumes a webservice over HTTPS. I have imported the certificate to a truststore. Right now I have hardcoded the location of the truststore in my EJB

      System.setProperty("javax.net.ssl.trustStore", "d:\\mytrustore");
      System.setProperty("javax.net.ssl.trustStorePassword","pwd");
      


      This works fine, but I don't like the hardcoding part. I have tried to add the trustsore to the ejb.jar, inside the same package as the EJB;

      System.setProperty("javax.net.ssl.trustStore", this.getClass().getResource("mytrustore").getFile()
      );
      System.setProperty("javax.net.ssl.trustStorePassword","pwd");
      


      and outside;

      System.setProperty("javax.net.ssl.trustStore", "mytrustore");
      System.setProperty("javax.net.ssl.trustStorePassword","pwd");
      


      But, I get an exception that no trusted certificate is found when I try this.

      So my questions are, where should I deploy the truststore really? Is there some configuration setting I can use to point out the truststore used by this SLSB?

      Cheers

      //Anders =)