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.

Cannot establish DTLS connection with certificate authentication mode to the leshan bootstrap server

See original GitHub issue

Hello,

I am using Demo Bootstrapping Server with Demo Client using X.509 security. I have connected the Demo Bootstrap server and inserted the Client Certificate and Client Private Key and End Point as recommended to the Bootstrap Sandbox. Upon Starting the client, the handshake fails and returns a Null Pointer Exception.

java.lang.NullPointerException: null
	at java.util.Objects.requireNonNull(Objects.java:203)
	at java.util.Arrays$ArrayList.<init>(Arrays.java:3813)
	at java.util.Arrays.asList(Arrays.java:3800)
	at org.eclipse.californium.scandium.dtls.ServerHandshaker.createCertificateRequest(ServerHandshaker.java:532)
	at org.eclipse.californium.scandium.dtls.ServerHandshaker.receivedClientHello(ServerHandshaker.java:400)
	at org.eclipse.californium.scandium.dtls.ServerHandshaker.doProcessMessage(ServerHandshaker.java:200)
	at org.eclipse.californium.scandium.dtls.Handshaker.processMessage(Handshaker.java:638)
	at org.eclipse.californium.scandium.DTLSConnector.startNewHandshake(DTLSConnector.java:1842)
	at org.eclipse.californium.scandium.DTLSConnector.processClientHello(DTLSConnector.java:1737)
	at org.eclipse.californium.scandium.DTLSConnector.access$1500(DTLSConnector.java:217)
	at org.eclipse.californium.scandium.DTLSConnector$12.run(DTLSConnector.java:1675)
	at org.eclipse.californium.elements.util.SerialExecutor$1.run(SerialExecutor.java:276)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)

Upon this, I have tried commenting out this part of the server code, since I am using a self signed certificate and do not need to verify the certificates on either ends:

                @Override
                public X509Certificate[] getAcceptedIssuers() {
                    return null;
                }
            })

The Null Pointer Exception was gone and was replaced with an error that client is using Unsupported CipherSuits where I ran the command with -oc to support deprecated ciphersuits but there was no use.

03:18:21.924 [DTLS-Connection-Handler-4] DEBUG org.eclipse.californium.scandium.dtls.Connection - Handshake with [/127.0.0.1:5687] has been started
03:18:21.933 [DTLS-Connection-Handler-4] INFO org.eclipse.californium.scandium.DTLSConnector - Aborting handshake with peer [/127.0.0.1:5687]: Client proposed unsupported cipher suites only
03:18:21.934 [DTLS-Connection-Handler-4] DEBUG org.eclipse.californium.scandium.DTLSConnector - Terminating connection with peer [/127.0.0.1:5687], reason [HANDSHAKE_FAILURE]
03:18:21.934 [DTLS-Connection-Handler-4] DEBUG org.eclipse.californium.scandium.DTLSConnector - send ALERT      Alert Protocol
        Level: FATAL
        Description: HANDSHAKE_FAILURE

My colleague also tried it with wakaama Client and the leshan BS demo server reported the same issue. I have attached logs and wireshark files hoping it will be of use.

Wireshark Leshan Demo Client

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
amelbocommented, Apr 29, 2020

Thanks! Keep up the good work. And thanks to @tolgahanakgun

0reactions
sbernard31commented, Apr 29, 2020

Thx to you to find a new bug 🙏 !

Read more comments on GitHub >

github_iconTop Results From Across the Web

AP can't join. DTLS connection closed by controller
Solved: Hi guys, 1140 APs don't register with the 5508 controller. Here are some debug outputs: AP's IP: 100.31 WLC's IP:100.2 debug capwap...
Read more >
[leshan-dev] Need information to test X509 certificate ... - Eclipse
Hi, I'm not sure, what exactly is send and what is used to verify the server certificate. Is it possible, that you open...
Read more >
tocol as Part of Multiprotocol Device Management System
to the factory bootstrap mode; the factory producing the devices does not need to be shared any server access information.
Read more >
LWM2M Device API Reference - ThingsBoard
ThingsBoard implements both LwM2M server and bootstrap server that supports plain UDP and DTLS (secure transport over UDP). ThingsBoard allows you to ...
Read more >
BG96 LwM2M User Guide - Quectel
Currently, BG96 supports two bootstrap modes in. LwM2M: factory bootstrap by default and client-initiated bootstrap. ○ Server and Access ...
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