io.netty.handler.codec.DecoderException: UaException: status=Bad_SecurityChecksFailed, message=java.security.cert.CertPathValidatorException: required KeyUsage 'digitalSignature' not found
at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:499)
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:290)
at io.netty.handler.codec.ByteToMessageCodec.channelRead(ByteToMessageCodec.java:103)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:442)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
at org.eclipse.milo.opcua.stack.client.transport.uasc.UascClientAcknowledgeHandler.decode(UascClientAcknowledgeHandler.java:171)
at io.netty.handler.codec.ByteToMessageCodec$1.decode(ByteToMessageCodec.java:42)
at io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:529)
at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:468)
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:290)
at io.netty.handler.codec.ByteToMessageCodec.channelRead(ByteToMessageCodec.java:103)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:442)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:440)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919)
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:166)
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:788)
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:724)
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:650)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:562)
at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997)
at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
at java.base/java.lang.Thread.run(Unknown Source)
Caused by: org.eclipse.milo.opcua.stack.core.UaException: java.security.cert.CertPathValidatorException: required KeyUsage 'digitalSignature' not found
at org.eclipse.milo.opcua.stack.core.util.validation.CertificateValidationUtil.validateTrustedCertPath(CertificateValidationUtil.java:287)
at org.eclipse.milo.opcua.stack.client.security.DefaultClientCertificateValidator.validateCertificateChain(DefaultClientCertificateValidator.java:79)
at org.eclipse.milo.opcua.stack.client.transport.uasc.UascClientMessageHandler.onOpenSecureChannel(UascClientMessageHandler.java:469)
at org.eclipse.milo.opcua.stack.client.transport.uasc.UascClientMessageHandler.decodeMessage(UascClientMessageHandler.java:394)
at org.eclipse.milo.opcua.stack.client.transport.uasc.UascClientMessageHandler.decode(UascClientMessageHandler.java:382)
at io.netty.handler.codec.ByteToMessageCodec$1.decode(ByteToMessageCodec.java:42)
at io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:529)
at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:468)
... 26 common frames omitted
Caused by: java.security.cert.CertPathValidatorException: required KeyUsage 'digitalSignature' not found
at java.base/sun.security.provider.certpath.PKIXMasterCertPathValidator.validate(Unknown Source)
at java.base/sun.security.provider.certpath.PKIXCertPathValidator.validate(Unknown Source)
at java.base/sun.security.provider.certpath.PKIXCertPathValidator.validate(Unknown Source)
at java.base/sun.security.provider.certpath.PKIXCertPathValidator.engineValidate(Unknown Source)
at java.base/java.security.cert.CertPathValidator.validate(Unknown Source)
at org.eclipse.milo.opcua.stack.core.util.validation.CertificateValidationUtil.validateTrustedCertPath(CertificateValidationUtil.java:249)
... 33 common frames omitted
Caused by: org.eclipse.milo.opcua.stack.core.UaException: required KeyUsage 'digitalSignature' not found
at org.eclipse.milo.opcua.stack.core.util.validation.CertificateValidationUtil.checkIssuerKeyUsage(CertificateValidationUtil.java:631)
at org.eclipse.milo.opcua.stack.core.util.validation.OpcUaCertificateUsageChecker.check(OpcUaCertificateUsageChecker.java:130)
... 39 common frames omitted
Perhaps there is something wrong with the field "Utilisation de la clé / usage de la key"
(certificate rejected in PM)
Another question, when this item will be solved, we would like to try to add CRL files.
If ignition doesn't use http url, we can download them an put it in the directory:
Ok, it seems that the issuer does not have Digital Signature indicated in its Key Usage and the certificate validation logic is expecting it to be there.
Looking closer at the spec it seems this may be a mistaken requirement of issuer certs, and is only required of the end entity (application instance) certificate, but I'll have to reach out to someone for verification.
There's nothing you can do to get this working unless re-generating those root and issuer certificates to include the missing Key Usage is a possibility. You might be able to get a connection to happen if you disable certificate validation all together for that connection (advanced setting).
For RSA keys, the keyUsage shall include digitalSignature, nonRepudiation, keyEncipherment and dataEncipherment.For ECC keys, the keyUsage shall include digitalSignature.Other keyUsage bits are allowed but not recommended.
Thanks a lot, I've upgraded my Ignition plateform with the last nightly available and the opcua module posted. I will keep you updated as soon as the PLC will be available tu run some test again.
If Ignition doesn't request automatically the http Uri name, can we put the file anywhere on the gateway in order it will be take in account ? is there a name convention ?
For example we can perhaps disable/enable the opc connection to force a new crl file to be processed ?
I send you by PM the CRL file provided by the http uri name.
You can just put it in the client/security/pki/issuers/crls folder, in der-encoded PKCS#7 format. The filename doesn't matter, any CRLs in that dir get read and included.