Results 1 to 2 of 2
  1. #1
    peterv6i is offline Member
    Join Date
    May 2011
    Posts
    3
    Rep Power
    0

    Default Using multiple SSL certificates from the same host (axis 1.4 - axis2) how?

    Hello,
    From my web application (JSF or Servlet). I need to connect to different webservices using https and certificates from the same host.
    I have imported multiple certificates in my keystore but I don't know how use them with axis or axis2?

    I have tryed with "System.setProperty"...
    but it's working only with first request.. If i like to call a second webservice which need other certificate I get error like this one:
    javax.net.ssl.SSLHandshakeException: Received fatal alert: bad_certificate


    Has someone some example on how to use a keystore and truststore with axis, axis2?

    I have tryed many examples from the web but with no success..

    My code work only if I setup this properties
    Java Code:
            System.setProperty("javax.net.ssl.keyStore","c:/cert/mycert.p12");
                 System.setProperty("javax.net.ssl.keyStorePassword", "119234646"); 
                 System.setProperty("javax.net.ssl.keyStoreType", "PKCS12");
                     
                 System.setProperty("javax.net.ssl.trustStore",  "c:/cert/myjks.jks");
                 System.setProperty("javax.net.ssl.trustStorePassword",  "54k7lp0p");
                 System.setProperty("javax.net.ssl.trustStoreType","JKS");

  2. #2
    peterv6i is offline Member
    Join Date
    May 2011
    Posts
    3
    Rep Power
    0

    Default

    what about multi thread an keystores?
    I used Axis 1.4 and axis-ssl library...

    Then I have made 2 jsp pages...
    First page get first keystore and certificate
    Second page get second keystore and certificate

    If i try to call the first web page (a.jsp) then the page b.jsp wan't work..
    In the second scenario after restart of my oc4j if I try to start page b.jsp then page a.jsp wan't work..

    Here is some pice of my code...

    Example for page a.jsp
    Java Code:
    SSLClientAxisEngineConfig axisConfig = new SSLClientAxisEngineConfig();
            axisConfig.setProtocol("TLS");
            axisConfig.setAlgorithm("SunX509");
            axisConfig.setKeyStore("c:/cert/test.p12");
            axisConfig.setKeyStoreType("PKCS12");
            axisConfig.setKeyStorePassword("119234646");
            axisConfig.setTrustStore("c:/cert/peter.jks");
            axisConfig.setTrustStorePassword("54k7lp0p");
            axisConfig.setTrustStoreType("JKS");
            try {
                MegaposProcessorServiceLocator loc = 
                    new MegaposProcessorServiceLocator(axisConfig);
                MegaposProcessor ws = loc.getprocessor();
    ...
    ...
    here is sample of page b.jsp
    Java Code:
     SSLClientAxisEngineConfig axisConfig = new SSLClientAxisEngineConfig();
            axisConfig.setProtocol("TLS");
            axisConfig.setAlgorithm("SunX509");
            axisConfig.setKeyStore("c:/cert/asarh.pfx");
            axisConfig.setKeyStoreType("PKCS12");
            axisConfig.setKeyStorePassword("54k7lp0p");
            axisConfig.setTrustStore("c:/cert/peter.jks");
            axisConfig.setTrustStorePassword("54k7lp0p");
            axisConfig.setTrustStoreType("JKS");
    
            try {
                LegacyNETServiceLocator loc = 
                    new LegacyNETServiceLocator(axisConfig);
                LegacyNETServiceSoap ws = loc.getLegacyNETServiceSoap12();
                out.print("<li>"+ ws.about());
            } catch (Exception ex) {
                out.println("<li><b>napaka: " + ex.toString());
            }
    Is there a way to run in paralell mode page a and page b each with different certificate?

    thank you for any help..

Similar Threads

  1. Three certificates and one keystore
    By peterv6i in forum Advanced Java
    Replies: 0
    Last Post: 05-05-2011, 03:35 PM
  2. Replies: 4
    Last Post: 10-01-2010, 11:52 AM
  3. How to create file into another host from a host
    By varadha in forum Networking
    Replies: 3
    Last Post: 02-10-2010, 10:03 PM
  4. copy file from local host to remote host
    By isotoper in forum New To Java
    Replies: 4
    Last Post: 12-24-2009, 05:41 PM
  5. Replies: 0
    Last Post: 10-31-2008, 08:07 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •