RE: Relative path keystore Axis2

Oscar Rugama <[email protected]>
Newsgroups gmane.text.xml.axis.user
Message-ID <[email protected]>
 Hi Robert:

 Thank you very much for pointing me.

  I have performed the following code:

         KeyStore theKeystore = null;
         
          try {
            InputStream theKeystoreInputStream = ClassLoader.getSystemResourceAsStream("keysdata.jks");
            theKeystore = KeyStore.getInstance("JKS");
            theKeystore.load(theKeystoreInputStream, null);
            theKeystoreInputStream.close();
        } catch (KeyStoreException ex) {
            java.util.logging.Logger.getLogger(AsnefWS.class.getName()).log(Level.SEVERE, null, ex);
        } catch (IOException ex) {
            java.util.logging.Logger.getLogger(AsnefWS.class.getName()).log(Level.SEVERE, null, ex);
        } catch (NoSuchAlgorithmException ex) {
            java.util.logging.Logger.getLogger(AsnefWS.class.getName()).log(Level.SEVERE, null, ex);
        } catch (CertificateException ex) {
            java.util.logging.Logger.getLogger(AsnefWS.class.getName()).log(Level.SEVERE, null, ex);
        }

And as far as I have debugged it, theKeystore  is not null.

Reaching this point, I have been trying to perform code to use theKeystore  but unfortunately I didn´t reach the solution.

I have surfing on google, and I found some examples using a SecureSocketFactory.

I have done my own SecureSocketFactory and I have told Axis like this

 AxisProperties.setProperty("axis.socketSecureFactory","solvenciacenter.webservice.impl.MyCustomSSLSocketFactory"); 

My call to the web service looks like:

IcTransactionServiceServiceStub service = new IcTransactionServiceServiceStub(axisContext, endpointURL);
     
            org.apache.axis2.transport.http.HttpTransportProperties.ProxyProperties HTTPProxyProperties = new org.apache.axis2.transport.http.HttpTransportProperties.ProxyProperties();
           HTTPProxyProperties.setProxyName(IberdrolaConfigurationManager.getProperty("ws.proxy.host"));
           HTTPProxyProperties.setProxyPort(Integer.parseInt(IberdrolaConfigurationManager.getProperty("ws.proxy.port")));
           HTTPProxyProperties.setUserName(proxyUser);
           HTTPProxyProperties.setPassWord(proxyPassword);
           org.apache.axis2.client.Options options = service._getServiceClient().getOptions();
           options.setProperty("PROXY", HTTPProxyProperties);

           respuesta = service.submit(peticionA);

And I´m still getting the same error about not finding the certificate.

Could you please point me what I´m understanding wrong?

Thank you very much

Kind regards




> Date: Wed, 27 Apr 2016 12:54:36 -0300
> Subject: Re: Relative path keystore Axis2
> From: [email protected]
> To: [email protected]
> 
> On Wed, Apr 27, 2016 at 12:25 PM, Oscar Rugama <[email protected]> wrote:
> >  Hi all:
> >
> >       I'm developing a web service using axis2 & tomcat .
> >
> <snip>
> > My project could be like that, so at first glance my keystore is placed at
> > the what I thought is the root level, so just writing
> >
> > System.setProperty("javax.net.ssl.keyStore", "keysdata.jks");
> >
> >
> > I thought it should look in the root level. But nothing works (I mean an
> > absolute path yes it works)
> >
> 
> I would try to use some form of getResourceAsSteam() . Lots of ways to
> do that. At the axis2 level, you should be able to do something like:
> 
> MessageContext.getCurrentMessageContext().getAxisService().getClassLoader().getResourceAsSteam("keysdata.jks");
> 
> - R
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.