[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[iaik-jce] error when trying load trusted certs



hi,

when I am trying to call :
       // load trusted certs
       FileInputStream fis = new
FileInputStream("/usr/myprojects/config/sono.der");
       CertificateFactory cf = CertificateFactory.getInstance("X.509",
"IAIK");
       X509Certificate cert[] =
{(X509Certificate)cf.generateCertificate(fis)};

       FileInputStream fkey = new
FileInputStream("/usr/myprojects/config/sono.p8");
       iaik.pkcs.pkcs8.EncryptedPrivateKeyInfo epki=
            new iaik.pkcs.pkcs8.EncryptedPrivateKeyInfo(fkey);
       epki.decrypt("mobbank1".toCharArray());
       PrivateKey key =epki.getPrivateKeyInfo();

       SSLClientContext context = new SSLClientContext();
       context.addClientCredentials(cert,key);

I get the error:

org.w3c.www.protocol.http.HttpException: java.net.SocketException:
Connection ab

orted by peer: socket write error
java.net.SocketException: Connection aborted by peer: socket write error
        at java.net.SocketOutputStream.socketWrite(Native Method)
        at java.net.SocketOutputStream.write(SocketOutputStream.java:83)
        at iaik.security.ssl.m.c(Unknown Source)
        at iaik.security.ssl.m.b(Unknown Source)
        at iaik.security.ssl.r.c(Unknown Source)
        at iaik.security.ssl.x.c(Unknown Source)
        at iaik.security.ssl.x.a(Unknown Source)
        at iaik.security.ssl.r.d(Unknown Source)
        at iaik.security.ssl.SSLTransport.startHandshake(Unknown Source)
        at iaik.security.ssl.SSLTransport.getOutputStream(Unknown Source)
        at iaik.security.ssl.SSLSocket.getOutputStream(Unknown Source)
        at org.w3c.www.protocol.http.f.markUsed(Unknown Source)
        at org.w3c.www.protocol.http.HttpBasicServer.getConnection(Unknown
Sourc

e)
        at org.w3c.www.protocol.http.HttpBasicServer.runRequest(Unknown
Source)
        at org.w3c.www.protocol.http.HttpManager.runRequest(Unknown Source)
        at org.w3c.www.protocol.http.HttpURLConnection.connect(Unknown
Source)


I get no error with the default SSLClientContext !?

  Kind regards
  Hamid Sarabi


--
Mailinglist-archive at
http://jcewww.iaik.at/mailarchive/iaik-jce/jcethreads.html

To unsubscribe send an email to listserv@iaik.at with the folowing content:
UNSUBSCRIBE iaik-jce