1
votes

I’m trying to use RPC to connect to my M12 CordaApp and call nodeIdentity() method, I'm getting org.bouncycastle.cert.CertIOException. I think the Java client code works, I can see the RPC connection and when I try to call getProtocolVersion() instead I see the correct protocol version.

Here is the stack trace when calling nodeIdentity():

10:50:25.848 [Thread-0 (ActiveMQ-client-global-threads-1076641925)] ERROR org.apache.activemq.artemis.core.client - AMQ214000: Failed to call onMessage
org.bouncycastle.cert.CertIOException: malformed data: sequence wrong size for a certificate
    at org.bouncycastle.cert.X509CertificateHolder.parseBytes(Unknown Source) ~[bcpkix-jdk15on-1.56.jar:1.56.0.0]
    at org.bouncycastle.cert.X509CertificateHolder.(Unknown Source) ~[bcpkix-jdk15on-1.56.jar:1.56.0.0]
    at net.corda.core.serialization.X509CertificateSerializer.read(Kryo.kt:641) ~[core-0.12.1.jar:?]
    at net.corda.core.serialization.X509CertificateSerializer.read(Kryo.kt:639) ~[core-0.12.1.jar:?]
    at com.esotericsoftware.kryo.Kryo.readObject(Kryo.java:731) ~[kryo-4.0.0.jar:?]
    at com.esotericsoftware.kryo.serializers.ObjectField.read(ObjectField.java:125) ~[kryo-4.0.0.jar:?]
    at com.esotericsoftware.kryo.serializers.CompatibleFieldSerializer.read(CompatibleFieldSerializer.java:147) ~[kryo-4.0.0.jar:?]
    at com.esotericsoftware.kryo.Kryo.readObjectOrNull(Kryo.java:782) ~[kryo-4.0.0.jar:?]
    at com.esotericsoftware.kryo.serializers.ObjectField.read(ObjectField.java:132) ~[kryo-4.0.0.jar:?]
    at com.esotericsoftware.kryo.serializers.CompatibleFieldSerializer.read(CompatibleFieldSerializer.java:147) ~[kryo-4.0.0.jar:?]
    at com.esotericsoftware.kryo.Kryo.readClassAndObject(Kryo.java:813) ~[kryo-4.0.0.jar:?]
    at com.esotericsoftware.kryo.serializers.CollectionSerializer.read(CollectionSerializer.java:134) ~[kryo-4.0.0.jar:?]
    at com.esotericsoftware.kryo.serializers.CollectionSerializer.read(CollectionSerializer.java:40) ~[kryo-4.0.0.jar:?]
    at com.esotericsoftware.kryo.Kryo.readObject(Kryo.java:731) ~[kryo-4.0.0.jar:?]
    at com.esotericsoftware.kryo.serializers.ObjectField.read(ObjectField.java:125) ~[kryo-4.0.0.jar:?]
    at com.esotericsoftware.kryo.serializers.CompatibleFieldSerializer.read(CompatibleFieldSerializer.java:147) ~[kryo-4.0.0.jar:?]
    at com.esotericsoftware.kryo.Kryo.readClassAndObject(Kryo.java:813) ~[kryo-4.0.0.jar:?]
    at com.esotericsoftware.kryo.serializers.CollectionSerializer.read(CollectionSerializer.java:134) ~[kryo-4.0.0.jar:?]
    at com.esotericsoftware.kryo.serializers.CollectionSerializer.read(CollectionSerializer.java:40) ~[kryo-4.0.0.jar:?]
    at com.esotericsoftware.kryo.Kryo.readObject(Kryo.java:731) ~[kryo-4.0.0.jar:?]
    at com.esotericsoftware.kryo.serializers.ObjectField.read(ObjectField.java:125) ~[kryo-4.0.0.jar:?]
    at com.esotericsoftware.kryo.serializers.CompatibleFieldSerializer.read(CompatibleFieldSerializer.java:147) ~[kryo-4.0.0.jar:?]
    at com.esotericsoftware.kryo.Kryo.readObject(Kryo.java:731) ~[kryo-4.0.0.jar:?]
    at com.esotericsoftware.kryo.serializers.ObjectField.read(ObjectField.java:125) ~[kryo-4.0.0.jar:?]
    at com.esotericsoftware.kryo.serializers.CompatibleFieldSerializer.read(CompatibleFieldSerializer.java:147) ~[kryo-4.0.0.jar:?]
    at com.esotericsoftware.kryo.Kryo.readClassAndObject(Kryo.java:813) ~[kryo-4.0.0.jar:?]
    at net.corda.core.serialization.KryoKt$deserialize$1$1.execute(Kryo.kt:110) ~[core-0.12.1.jar:?]
    at net.corda.core.serialization.KryoPoolWithContext.run(Kryo.kt:653) ~[core-0.12.1.jar:?]
    at net.corda.core.serialization.KryoKt.deserialize(Kryo.kt:110) ~[core-0.12.1.jar:?]
    at net.corda.nodeapi.RPCApi$ServerToClient$Companion.fromClientMessage(RPCApi.kt:177) ~[node-api-0.12.1.jar:?]
    at net.corda.client.rpc.internal.RPCClientProxyHandler.artemisMessageHandler(RPCClientProxyHandler.kt:224) ~[rpc-0.12.1.jar:?]
    at net.corda.client.rpc.internal.RPCClientProxyHandler.access$artemisMessageHandler(RPCClientProxyHandler.kt:58) ~[rpc-0.12.1.jar:?]
    at net.corda.client.rpc.internal.RPCClientProxyHandler$start$3.invoke(RPCClientProxyHandler.kt:174) ~[rpc-0.12.1.jar:?]
    at net.corda.client.rpc.internal.RPCClientProxyHandler$start$3.invoke(RPCClientProxyHandler.kt:58) ~[rpc-0.12.1.jar:?]
    at net.corda.client.rpc.internal.RPCClientProxyHandlerKt$sam$MessageHandler$43516406.onMessage(RPCClientProxyHandler.kt) ~[rpc-0.12.1.jar:?]
    at org.apache.activemq.artemis.core.client.impl.ClientConsumerImpl.callOnMessage(ClientConsumerImpl.java:1001) ~[artemis-core-client-1.5.3.jar:1.5.3]
    at org.apache.activemq.artemis.core.client.impl.ClientConsumerImpl.access$400(ClientConsumerImpl.java:49) ~[artemis-core-client-1.5.3.jar:1.5.3]
    at org.apache.activemq.artemis.core.client.impl.ClientConsumerImpl$Runner.run(ClientConsumerImpl.java:1124) [artemis-core-client-1.5.3.jar:1.5.3]
    at org.apache.activemq.artemis.utils.OrderedExecutorFactory$OrderedExecutor$ExecutorTask.run(OrderedExecutorFactory.java:101) [artemis-commons-1.5.3.jar:1.5.3]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:1.8.0_131]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:1.8.0_131]
    at java.lang.Thread.run(Thread.java:748) [?:1.8.0_131]
Caused by: java.lang.IllegalArgumentException: sequence wrong size for a certificate
    at org.bouncycastle.asn1.x509.Certificate.(Unknown Source) ~[bcprov-jdk15on-1.56.jar:1.56.0]
    at org.bouncycastle.asn1.x509.Certificate.getInstance(Unknown Source) ~[bcprov-jdk15on-1.56.jar:1.56.0]
    ... 42 more

It looks there is something wrong with X509 Certificate serialization, did I miss something?

1

1 Answers

0
votes

We suspect this may be fixed in M13 but M14 is right around the corner, so it may be worth waiting and just updating straight to that.