IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Services Web Java Discussion :

Incompatibilité de certificat


Sujet :

Services Web Java

  1. #1
    Membre éclairé Avatar de rockley
    Homme Profil pro
    Inscrit en
    Décembre 2010
    Messages
    404
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations forums :
    Inscription : Décembre 2010
    Messages : 404
    Par défaut Incompatibilité de certificat
    Bonjour à tous

    Je dois créer un Web service avec une authentification réciproque. (Pour plus d'info).
    http://download.oracle.com/javaee/1.....html#wp182253

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
     
            System.setProperty("javax.net.ssl.keyStoreType", "PKCS12");
            //System.setProperty("javax.net.ssl.keyStoreType", "JKS");
            System.setProperty("javax.net.ssl.keyStore", pk12);
            //System.setProperty("javax.net.ssl.keyStore", client.jks);
            System.setProperty("javax.net.ssl.keyStorePassword", "PK12Pass");
     
     
            System.setProperty("javax.net.ssl.trustStoreType", "PKCS12");
            //System.setProperty("javax.net.ssl.trustStoreType", "JKS");       
            System.setProperty("javax.net.ssl.trustStore", TrustStore) ;
            System.setProperty("javax.net.ssl.trustStorePassword", "changeit");
    J'utilise J2SDK 1.4 (java 1.4).
    Quand j'utilise le pk12 j'ai cette erreur :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    ATTENTION: Unable to find required classes (javax.activation.DataHandler and javax.mail.internet.MimeMultipart). Attachment support is disabled.
    AxisFault
     faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
     faultSubcode: 
     faultString: java.net.SocketException: Default SSL context init failed: DerInputStream.getLength(): lengthTag=109, too big.
     faultActor: 
     faultNode: 
     faultDetail: 
    	{http://xml.apache.org/axis/}stackTrace:java.net.SocketException: Default SSL context init failed: DerInputStream.getLength(): lengthTag=109, too big.
    	at javax.net.ssl.DefaultSSLSocketFactory.createSocket(DashoA12275)
    	at org.apache.axis.components.net.JSSESocketFactory.create(JSSESocketFactory.java:92)
    	at org.apache.axis.transport.http.HTTPSender.getSocket(HTTPSender.java:191)
    	at org.apache.axis.transport.http.HTTPSender.writeToSocket(HTTPSender.java:404)
    	at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:138)
    	at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
    	at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
    	at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
    	at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)
    	at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
    	at org.apache.axis.client.Call.invoke(Call.java:2767)
    	at org.apache.axis.client.Call.invoke(Call.java:2443)
    	at org.apache.axis.client.Call.invoke(Call.java:2366)
    	at org.apache.axis.client.Call.invoke(Call.java:1812)
    	at com.e_i.services.ws.otp.OTPServiceSoapStub.sendTextOtp(OTPServiceSoapStub.java:348)
    	at com.e_i.services.ws.otp.OTPServiceSoapProxy.sendTextOtp(OTPServiceSoapProxy.java:50)
    	at WStest.sendTextOtp(WStest.java:173)
    	at WStest.main(WStest.java:132)
     
     
    java.net.SocketException: Default SSL context init failed: DerInputStream.getLength(): lengthTag=109, too big.
    	at org.apache.axis.AxisFault.makeFault(AxisFault.java:101)
    	at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:154)
    	at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
    	at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
    	at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
    	at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)
    	at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
    	at org.apache.axis.client.Call.invoke(Call.java:2767)
    	at org.apache.axis.client.Call.invoke(Call.java:2443)
    	at org.apache.axis.client.Call.invoke(Call.java:2366)
    	at org.apache.axis.client.Call.invoke(Call.java:1812)
    	at com.e_i.services.ws.otp.OTPServiceSoapStub.sendTextOtp(OTPServiceSoapStub.java:348)
    	at com.e_i.services.ws.otp.OTPServiceSoapProxy.sendTextOtp(OTPServiceSoapProxy.java:50)
    	at WStest.sendTextOtp(WStest.java:173)
    	at WStest.main(WStest.java:132)
    Caused by: java.net.SocketException: Default SSL context init failed: DerInputStream.getLength(): lengthTag=109, too big.
    	at javax.net.ssl.DefaultSSLSocketFactory.createSocket(DashoA12275)
    	at org.apache.axis.components.net.JSSESocketFactory.create(JSSESocketFactory.java:92)
    	at org.apache.axis.transport.http.HTTPSender.getSocket(HTTPSender.java:191)
    	at org.apache.axis.transport.http.HTTPSender.writeToSocket(HTTPSender.java:404)
    	at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:138)
    	... 13 more

    Et pour le JKS ça donne :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    ATTENTION: Unable to find required classes (javax.activation.DataHandler and javax.mail.internet.MimeMultipart). Attachment support is disabled.
    AxisFault
     faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
     faultSubcode: 
     faultString: java.net.SocketException: Default SSL context init failed: Cannot recover key
     faultActor: 
     faultNode: 
     faultDetail: 
    	{http://xml.apache.org/axis/}stackTrace:java.net.SocketException: Default SSL context init failed: Cannot recover key
    	at javax.net.ssl.DefaultSSLSocketFactory.createSocket(DashoA12275)
    	at org.apache.axis.components.net.JSSESocketFactory.create(JSSESocketFactory.java:92)
    	at org.apache.axis.transport.http.HTTPSender.getSocket(HTTPSender.java:191)
    	at org.apache.axis.transport.http.HTTPSender.writeToSocket(HTTPSender.java:404)
    	at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:138)
    	at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
    	at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
    	at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
    	at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)
    	at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
    	at org.apache.axis.client.Call.invoke(Call.java:2767)
    	at org.apache.axis.client.Call.invoke(Call.java:2443)
    	at org.apache.axis.client.Call.invoke(Call.java:2366)
    	at org.apache.axis.client.Call.invoke(Call.java:1812)
    	at com.e_i.services.ws.otp.OTPServiceSoapStub.sendTextOtp(OTPServiceSoapStub.java:348)
    	at com.e_i.services.ws.otp.OTPServiceSoapProxy.sendTextOtp(OTPServiceSoapProxy.java:50)
    	at WStest.sendTextOtp(WStest.java:173)
    	at WStest.main(WStest.java:132)
     
     
     
    java.net.SocketException: Default SSL context init failed: Cannot recover key
    	at org.apache.axis.AxisFault.makeFault(AxisFault.java:101)
    	at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:154)
    	at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
    	at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
    	at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
    	at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)
    	at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
    	at org.apache.axis.client.Call.invoke(Call.java:2767)
    	at org.apache.axis.client.Call.invoke(Call.java:2443)
    	at org.apache.axis.client.Call.invoke(Call.java:2366)
    	at org.apache.axis.client.Call.invoke(Call.java:1812)
    	at com.e_i.services.ws.otp.OTPServiceSoapStub.sendTextOtp(OTPServiceSoapStub.java:348)
    	at com.e_i.services.ws.otp.OTPServiceSoapProxy.sendTextOtp(OTPServiceSoapProxy.java:50)
    	at WStest.sendTextOtp(WStest.java:173)
    	at WStest.main(WStest.java:132)
    Caused by: java.net.SocketException: Default SSL context init failed: Cannot recover key
    	at javax.net.ssl.DefaultSSLSocketFactory.createSocket(DashoA12275)
    	at org.apache.axis.components.net.JSSESocketFactory.create(JSSESocketFactory.java:92)
    	at org.apache.axis.transport.http.HTTPSender.getSocket(HTTPSender.java:191)
    	at org.apache.axis.transport.http.HTTPSender.writeToSocket(HTTPSender.java:404)
    	at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:138)
    	... 13 more


    Ce sont des erreurs assez rare et difficile à trouver. Du moins sur les forums français.

    Ces deux erreurs viennent d'une incompatibilité de clef dans les certificats.
    (RSA de longueur 1024 à ne pas dépasser dans le JDK 1.4).


    Donc je me retrouve dans une situation assez délicate.
    Le Web service ne peux pas me faire des clefs plus petites à cause de sa sécurité. Et moi je peux pas envoyer de clef trop grande.

    Une incompatibilité dans les web services est, faut le dire, assez spéciale.

    Qu'en pensez vous ? Avez-vous des idées ?

  2. #2
    Membre éclairé Avatar de rockley
    Homme Profil pro
    Inscrit en
    Décembre 2010
    Messages
    404
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations forums :
    Inscription : Décembre 2010
    Messages : 404
    Par défaut
    La solution est de passer par un proxy (rivers) tomcat ou autre.

    C'est le proxy qui s'occupe de l'authentification (certificat).
    Le endpoint du client Web service pointe sur l'url du proxy.

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. Certificats et HTTPS
    Par jean.lamy dans le forum Sécurité
    Réponses: 3
    Dernier message: 24/06/2004, 15h31
  2. Réponses: 2
    Dernier message: 25/05/2004, 11h40
  3. UPDATE+max= Incompatibilité?
    Par $grm$ dans le forum PostgreSQL
    Réponses: 1
    Dernier message: 21/05/2004, 16h43
  4. problème d'incompatibilité apparement
    Par stephane eyskens dans le forum Flash
    Réponses: 8
    Dernier message: 17/09/2003, 14h51

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo