You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Christian Kunert <ch...@nexnet.de> on 2005/06/03 11:03:00 UTC

client authorization with pkcs12

Hello,

 

I have the following problem:

 

i wrote an axis client for an external service. I got a p12 file to
authorize me but I get an Exception:

 

AxisFault

 faultCode:
{http://schemas.xmlsoap.org/soap/envelope/}Server.userException

 faultSubcode: 

 faultString: java.net.SocketException: Default SSL context init failed:
Invalid keystore format

 faultActor: 

 faultNode: 

 faultDetail:  

 

Here is my code:

 

this.binding = (SoapBindingStub) this.locator.getSoapPort();

 

String file = this.getClass().getResource("xyz.p12").getFile();

this.binding.setUsername( "username" ); 

this.binding.setPassword("password" ); 

System.setProperty("javax.net.ssl.keyStore",file);

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

 

 

I thin i'm on the wrong way.. 

Any advices?

 

 

 

___________________________________
Produktion und Entwicklung
NEXNET GmbH
Am Borsigturm 12

13507 Berlin

Tel.: +49 30 726297 411
Mail: christian.kunert@nexnet.de

 


Re: client authorization with pkcs12

Posted by "C.C. Ang" <ch...@utiba.com>.
> o What about 
> >    System.setProperty("javax.net.ssl.keyStorePassword", file);

Ooops.... I meant
   System.setProperty("javax.net.ssl.keyStorePassword", password);

-- 
| The most erroneous stories are those we think we know best and
| therefore never scrutinize or question. -- Stephen Jay Gould 1941-2002

-----------------
Utiba Pty Ltd 
This message has been scanned for viruses and
dangerous content by Utiba mail server and is 
believed to be clean.


Re: client authorization with pkcs12

Posted by "C.C. Ang" <ch...@utiba.com>.
On Fri, Jun 03, 2005 at 11:03:00AM +0200, Christian Kunert wrote:
> 
>    Hello,
> 
> 
>    I have the following problem:
> 
>    String file = this.getClass().getResource("xyz.p12").getFile();
> 
>    this.binding.setUsername( "username" );
> 
>    this.binding.setPassword("password" );
> 
>    System.setProperty("javax.net.ssl.keyStore",file);
> 
>    System.setProperty("javax.net.ssl.trustStore",file);
> 

Few things u can try.

o What about 
>    System.setProperty("javax.net.ssl.keyStorePassword", file);

o Whatever 'file' is, do a 
$ keytool -list -v -keystore
  on it to see if it is really invalid.

Hopefully, one of the above 2 may solve your problem.

Regards,
Chai

-- 
| "What's the matter?" "It's Patty." "Jerry, you break up with a girl
| every week." "What is this salty discharge?" "Oh my God, you're
| crying." "This is horrible. I care." - Elaine and Jerry, in "The
| Serenity Now"

-----------------
Utiba Pty Ltd 
This message has been scanned for viruses and
dangerous content by Utiba mail server and is 
believed to be clean.