question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

DTLS Client Certificate Chain not sent

See original GitHub issue

Currently we are implementing client/server DTLS communication with Leshan for an IoT project. Unfortunately, the handshake fails because the Leshan client just sends a single certificate to the Leshan Server (recorded with Wireshark) instead of the whole chain (Root CA -> Intermediate CA -> Client Cert):

13:44:43.387 [DTLS-Retransmit-Task-1] DEBUG org.eclipse.californium.scandium.dtls.CertificateMessage - created CERTIFICATE message with certificate chain [length: 1]

The server’s certificate message contains the expected chain, so there is no problem with the LeshanServerBuilder.

We definitely set the chain in the DTLS client config:

private val builder: LeshanClientBuilder = LeshanClientBuilder("1122334455667788990")
val leshanClient: LeshanClient
// ...

val dtlsConfig = DtlsConnectorConfig.Builder()
dtlsConfig.setIdentity(
            clientPrivateKey,
            arrayOf(
                clientCert,
                intermediateCAcert,
                rootCAcert
            )
)
builder.setDtlsConfig(dtlsConfig)

// ...
leshanClient = builder.build()
leshanClient.start()

In the createEndpoint(ServerInfo serverInfo) method of CaliforniumEndpointsManager I noticed the following:

newBuilder.setIdentity(serverInfo.privateKey, new Certificate[] { serverInfo.clientCertificate }); is called. This call overwrites the chain of certificates. So a single certificate (the client certificate) is written to the DTLS config, instead of the whole certificate chain. After that createSecuredEndpoint is called with an invalid certificate chain based on the DTLS config builder, called newBuilder.

Is this a bug or should I check other parameters of my LeshanClient?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
sbernard31commented, Sep 30, 2020

Only the client certificate chain is not clear in LWM2M specification. For server, I don’t see any issue. 🙂

0reactions
sbernard31commented, Oct 29, 2021

Following https://github.com/OpenMobileAlliance/OMA_LwM2M_for_Developers/issues/502#issuecomment-763698433, the lwm2m specification clarify that client certificate chain is limited to only 1 certificate. At least this is my understanding. 😕

I close this issue, but it could be related in a way to #1135

Read more comments on GitHub >

github_iconTop Results From Across the Web

tls - Does client have to send the CA chain along with the ...
In this situation, we see the client only sending back the client cert without the chain. Is that why I see the handshake...
Read more >
why doesn't java send the client certificate during SSL ...
If you only get one certificate per alias entry, they're not together. You would need to import your certificate and its chain together...
Read more >
Android EAP-TLS Client not sending Intermediate Certificate
We're introducing an intermediate certifcate to our client certificate chain and are unable to authentication against our EAP-TLS service ...
Read more >
SSL Handshake Failures - Bad Client Certificate | Apigee Edge
Does not have any Client Certificate in its KeyStore, or;; It is unable to send a Client Certificate. This can happen if it...
Read more >
How Certificate Chains Work - DigiCert Knowledge Base
If the Intermediate Certificate is not installed on the server (where the SSL/TLS certificate is installed) it may prevent some browsers, mobile ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found