eclipse-archived / californium.scandium Goto Github PK
View Code? Open in Web Editor NEWCalifornium project
Californium project
Hi all, I am having the following problem with the scandium library. With the previous version of the library, I was experimenting this issue: 5140b58, related to messages discarding, so I am using the latest verstion. In my scenario I have a client and a server that are used for tests. When both are in the same machine, the CoAP-DTLS exchange works perfectly, even if they are in the same network (or "physically close"), but not when they are separate (indeed, I am testing with both entities running in different countries). Taking a look to the debug info, I see the client receives the "HelloVerifyRequest" message and sends a "ClientHello" again in both cases, but when it is not working, the server says:
[DTLSConnector] Sending flight of [5] messages to peer and finally, [DTLSConnector] Maximum retransmission reached. In this case, the client does not receive additonal messages.
I am not sure if this can be related to retransmission time or messages are directly lost. Any help is more than welcome.
Thank you so much in advance
Regards
In my scenario, I have a client
Hi,
I'm just wondering, if the issues is still in progress :-).
From (deprecated) Bugzilla:
Sometimes, when messages are send during handshake, this results in accidently retries of CLIENT_HELLO "long" after exchanging application data proofed the session.
This could be reproduced with a leshan client by:
Sometimes the CLIENT_HELLO is very close to the app data. So this may
be caused by some "race condition". But setting the timing to distinguished
values (e.g. CoAP ACK 5s, DTLS Timeout 15s) you will see the CLIENT_HELLO a couple of seconds after the application data.
As far as I could analyse the problem, it may be fixed by cancel a potential flight from a previous handshake:
DTLSConnector.sendNextMessageOverNetwork()
..
if (handshaker != null) {
// get starting handshake message
flight = handshaker.getStartHandshakeMessage();
// cancel potential flight from previous handshake
connection.cancelPendingFlight();
connection.setPendingFlight(flight);
scheduleRetransmission(flight);
}
I also found a second issue at the flight "housekeeping"
(same class and method)
if (connection.isResumptionRequired()){
// create the session to resume from the previous one.
DTLSSession resumableSession = new DTLSSession(peerAddress, session, 0);
// terminate the previous connection and add the new one to the store
Connection newConnection = new Connection(peerAddress);
terminateConnection(connection, null, null);
connectionStore.put(newConnection);
handshaker = new ResumingClientHandshaker(message, resumableSession, newConnection, config);
// change connection to new instance, it's used later
connection = newConnection
}
(Sorry for not preparing a PR, but currently the master is changing a lot, so I think, it's faster for all to do it that way.)
OK, when the repositories are merge, I will prepare a PR :
I see that in my log sometimes, I don't know what is triggering that, but I think it worth exploring.
WARNING: Exception "java.lang.NullPointerException" in thread DTLS-Sender-0.0.0.0/0.0.0.0:5684
java.lang.NullPointerException
at org.eclipse.californium.scandium.dtls.ClientHello.fragmentToByteArray(ClientHello.java:194)
at org.eclipse.californium.scandium.dtls.Handshaker.wrapMessage(Handshaker.java:566)
at org.eclipse.californium.scandium.dtls.ResumingClientHandshaker.getStartHandshakeMessage(ResumingClientHandshaker.java:187)
at org.eclipse.californium.scandium.DTLSConnector.sendNext(DTLSConnector.java:463)
at org.eclipse.californium.elements.ConnectorBase.sendNextMessageOverNetwork(ConnectorBase.java:140)
at org.eclipse.californium.elements.ConnectorBase.access$100(ConnectorBase.java:36)
at org.eclipse.californium.elements.ConnectorBase$1.work(ConnectorBase.java:156)
at org.eclipse.californium.elements.ConnectorBase$Worker.run(ConnectorBase.java:219)
I want to use scandium and tinydtls in one of my projects but i've got one problem. Scandium sends flight 4 as one big message ~570B (with multiple records). Tinydtls catch whole message and process each record. It works.
Tinydtls sends one record in one message and after each message it receive last flight (flight 4) until it sends last record - Finished. So my question is: Does Scandium wait for the whole flight 5 (from client) to be sent by client in one message?
Thanks for help!
M4 has some issue for me so I've used 1.0 snapshot till now.
So I'm happy to see RC1 release but I cannot get RC1 on release repository.
(https://repo.eclipse.org/content/repositories/californium-releases)
Is there any problem to upload RC1 on release repository?
When a client starts a handshake with CLIENT_HELLO and the server response with HelloVerifyRequest, this reponse may be lost. In that case, the ServerHandshaker seems to block. New arriving CLIENT_HELLO is ignored ("Discarded message due to older message_seq: 0, next_receive_seq: 1"). This state seems to be static and only restarting the server fixes the problem.
15 INFO [DTLSConnector]: Created new session as server with peer: /0:0:0:0:0:0:0:1:8000 - (org.eclipse.californium.scandium.DTLSConnector.java:362) receiveNext() in thread DTLS-Receiver-0.0.0.0/0.0.0.0:5684 at (2015-03-12 13:12:51)
15 FINEST [DTLSConnector]: Stored handshaker: org.eclipse.californium.scandium.dtls.ServerHandshaker@77ac385a for /0:0:0:0:0:0:0:1:8000 - (org.eclipse.californium.scandium.DTLSConnector.java:372) receiveNext() in thread DTLS-Receiver-0.0.0.0/0.0.0.0:5684 at (2015-03-12 13:12:51)
15 FINE [ServerHandshaker]: DTLS Message processed (/0:0:0:0:0:0:0:1:8000):
==[ DTLS Message ]============================================
Content Type: Handshake (22)
Version: 254, 253
Epoch: 0
Sequence Number: 0
Length: 54
Handshake Protocol
Type: Client Hello (1)
Message Sequence: 0
Fragment Offset: 0
Fragment Length: 42
Length: 42
Version: 254, 253
Random:
GMT Unix Time: Thu Jan 01 01:00:14 CET 1970
Random Bytes: 8D D0 4A 30 81 F0 17 93 61 AB 5F C3 4F 08 68 4A 2C DC 4C CB 0D E4 36 2F 09 34 F8 B7
Session ID Length: 0
Cookie Length: 0
Cipher Suites Length: 2
Cipher Suites (1 suites)
Cipher Suite: TLS_PSK_WITH_AES_128_CCM_8
Compression Methods Length: 1
Compression Methods (1 method)
Compression Method: NULL
=============================================================== - (org.eclipse.californium.scandium.dtls.ServerHandshaker.java:241) processMessage() in thread DTLS-Receiver-0.0.0.0/0.0.0.0:5684 at (2015-03-12 13:12:51)15 FINEST [DTLSConnector]: => find handshaker for key /0:0:0:0:0:0:0:1:8000 - (org.eclipse.californium.scandium.DTLSConnector.java:193) receiveNext() in thread DTLS-Receiver-0.0.0.0/0.0.0.0:5684 at (2015-03-12 13:12:56)
15 FINEST [DTLSConnector]: => contentType: Handshake (22) - (org.eclipse.californium.scandium.DTLSConnector.java:208) receiveNext() in thread DTLS-Receiver-0.0.0.0/0.0.0.0:5684 at (2015-03-12 13:12:56)
15 FINEST [DTLSConnector]: => handshaker: org.eclipse.californium.scandium.dtls.ServerHandshaker@77ac385a - (org.eclipse.californium.scandium.DTLSConnector.java:275) receiveNext() in thread DTLS-Receiver-0.0.0.0/0.0.0.0:5684 at (2015-03-12 13:12:56)
15 INFO [Handshaker]: Discarded message due to older message_seq: 0, next_receive_seq: 1 - (org.eclipse.californium.scandium.dtls.Handshaker.java:651) processMessageNext() in thread DTLS-Receiver-0.0.0.0/0.0.0.0:5684 at (2015-03-12 13:12:56)
15 FINEST [DTLSConnector]: => find handshaker for key /0:0:0:0:0:0:0:1:8000 - (org.eclipse.californium.scandium.DTLSConnector.java:193) receiveNext() in thread DTLS-Receiver-0.0.0.0/0.0.0.0:5684 at (2015-03-12 13:13:01)
15 FINEST [DTLSConnector]: => contentType: Handshake (22) - (org.eclipse.californium.scandium.DTLSConnector.java:208) receiveNext() in thread DTLS-Receiver-0.0.0.0/0.0.0.0:5684 at (2015-03-12 13:13:01)
15 FINEST [DTLSConnector]: => handshaker: org.eclipse.californium.scandium.dtls.ServerHandshaker@77ac385a - (org.eclipse.californium.scandium.DTLSConnector.java:275) receiveNext() in thread DTLS-Receiver-0.0.0.0/0.0.0.0:5684 at (2015-03-12 13:13:01)
15 INFO [Handshaker]: Discarded message due to older message_seq: 0, next_receive_seq: 1 - (org.eclipse.californium.scandium.dtls.Handshaker.java:651) processMessageNext() in thread DTLS-Receiver-0.0.0.0/0.0.0.0:5684 at (2015-03-12 13:13:01)
15 FINEST [DTLSConnector]: => find handshaker for key /0:0:0:0:0:0:0:1:8000 - (org.eclipse.californium.scandium.DTLSConnector.java:193) receiveNext() in thread DTLS-Receiver-0.0.0.0/0.0.0.0:5684 at (2015-03-12 13:13:13)
15 FINEST [DTLSConnector]: => contentType: Handshake (22) - (org.eclipse.californium.scandium.DTLSConnector.java:208) receiveNext() in thread DTLS-Receiver-0.0.0.0/0.0.0.0:5684 at (2015-03-12 13:13:13)
15 FINEST [DTLSConnector]: => handshaker: org.eclipse.californium.scandium.dtls.ServerHandshaker@77ac385a - (org.eclipse.californium.scandium.DTLSConnector.java:275) receiveNext() in thread DTLS-Receiver-0.0.0.0/0.0.0.0:5684 at (2015-03-12 13:13:13)
15 INFO [Handshaker]: Discarded message due to older message_seq: 0, next_receive_seq: 1 - (org.eclipse.californium.scandium.dtls.Handshaker.java:651) processMessageNext() in thread DTLS-Receiver-0.0.0.0/0.0.0.0:5684 at (2015-03-12 13:13:13)
15 FINEST [DTLSConnector]: => find handshaker for key /0:0:0:0:0:0:0:1:8000 - (org.eclipse.californium.scandium.DTLSConnector.java:193) receiveNext() in thread DTLS-Receiver-0.0.0.0/0.0.0.0:5684 at (2015-03-12 13:13:18)
15 FINEST [DTLSConnector]: => contentType: Handshake (22) - (org.eclipse.californium.scandium.DTLSConnector.java:208) receiveNext() in thread DTLS-Receiver-0.0.0.0/0.0.0.0:5684 at (2015-03-12 13:13:18)
15 FINEST [DTLSConnector]: => handshaker: org.eclipse.californium.scandium.dtls.ServerHandshaker@77ac385a - (org.eclipse.californium.scandium.DTLSConnector.java:275) receiveNext() in thread DTLS-Receiver-0.0.0.0/0.0.0.0:5684 at (2015-03-12 13:13:18)15 INFO [Handshaker]: Discarded message due to older message_seq: 0, next_receive_seq: 1 - (org.eclipse.californium.scandium.dtls.Handshaker.java:651) processMessageNext() in thread DTLS-Receiver-0.0.0.0/0.0.0.0:5684 at (2015-03-12 13:13:18)
...
15 INFO [Handshaker]: Discarded message due to older message_seq: 0, next_receive_seq: 1 - (org.eclipse.californium.scandium.dtls.Handshaker.java:651) processMessageNext() in thread DTLS-Receiver-0.0.0.0/0.0.0.0:5684 at (2015-03-12 13:35:32)
blocks for more then 20 minutes => restart the server.
The DTLSv1_listen() in OpenSSL cannot finish the handshake to scandium. Scandium can receive the "Hello Verify" from OpenSSL. But after that, Scandium receive a ALERT message and terminate the handshake.
How can I finish the handshake and communication process between scandium and OpenSSL?
I have tried to use a different to connect a scandium server and scandium client and the result is that it does not work.For example i used port 5685 for the server and port 5684 for the client and
the log with the error is the following
Φεβ 06, 2015 3:04:03 ΠΜ org.eclipse.californium.scandium.dtls.Handshaker processMessageNext
INFO: Discarded message due to older message_seq: 1, next_receive_seq: 6
Φεβ 06, 2015 3:04:03 ΠΜ org.eclipse.californium.scandium.dtls.Handshaker processMessageNext
INFO: Discarded message due to older message_seq: 2, next_receive_seq: 6
Φεβ 06, 2015 3:04:03 ΠΜ org.eclipse.californium.scandium.dtls.Handshaker processMessageNext
INFO: Discarded message due to older message_seq: 3, next_receive_seq: 6
Φεβ 06, 2015 3:04:03 ΠΜ org.eclipse.californium.scandium.dtls.Handshaker processMessageNext
INFO: Discarded message due to older message_seq: 4, next_receive_seq: 6
Φεβ 06, 2015 3:04:03 ΠΜ org.eclipse.californium.scandium.dtls.Handshaker processMessageNext
INFO: Discarded message due to older message_seq: 5, next_receive_seq: 6
Φεβ 06, 2015 3:04:05 ΠΜ org.eclipse.californium.scandium.dtls.Handshaker processMessageNext
INFO: Queued newer message from same epoch, message_seq: 1, next_receive_seq: 0
Φεβ 06, 2015 3:04:05 ΠΜ org.eclipse.californium.scandium.dtls.Handshaker processMessageNext
INFO: Queued newer message from same epoch, message_seq: 2, next_receive_seq: 0
Φεβ 06, 2015 3:04:05 ΠΜ org.eclipse.californium.scandium.dtls.Handshaker processMessageNext
INFO: Queued newer message from same epoch, message_seq: 3, next_receive_seq: 0
Φεβ 06, 2015 3:04:05 ΠΜ org.eclipse.californium.scandium.dtls.Handshaker processMessageNext
INFO: Queued newer message from same epoch, message_seq: 4, next_receive_seq: 0
Φεβ 06, 2015 3:04:05 ΠΜ org.eclipse.californium.scandium.dtls.Handshaker processMessageNext
INFO: Queued newer message from same epoch, message_seq: 5, next_receive_seq: 0
Φεβ 06, 2015 3:04:06 ΠΜ org.eclipse.californium.scandium.dtls.Handshaker processMessageNext
INFO: Discarded message from /192.168.2.9:5685 due to older epoch.
Φεβ 06, 2015 3:04:06 ΠΜ org.eclipse.californium.scandium.dtls.Handshaker processMessageNext
INFO: Discarded message from /192.168.2.9:5685 due to older epoch.
Φεβ 06, 2015 3:04:06 ΠΜ org.eclipse.californium.scandium.dtls.Handshaker processMessageNext
INFO: Discarded message from /192.168.2.9:5685 due to older epoch.
Φεβ 06, 2015 3:04:06 ΠΜ org.eclipse.californium.scandium.dtls.Handshaker processMessageNext
INFO: Discarded message from /192.168.2.9:5685 due to older epoch.
Φεβ 06, 2015 3:04:06 ΠΜ org.eclipse.californium.scandium.dtls.Handshaker processMessageNext
INFO: Discarded message from /192.168.2.9:5685 due to older epoch.
Φεβ 06, 2015 3:04:06 ΠΜ org.eclipse.californium.elements.ConnectorBase$Worker run
WARNING: Exception "java.lang.NullPointerException" in thread DTLS-Receiver-/192.168.2.2:5684
java.lang.NullPointerException
at org.eclipse.californium.scandium.dtls.Record.decryptFragment(Record.java:266)
at org.eclipse.californium.scandium.dtls.Record.getFragment(Record.java:535)
at org.eclipse.californium.scandium.dtls.Handshaker.processMessageNext(Handshaker.java:626)
at org.eclipse.californium.scandium.dtls.ResumingClientHandshaker.processMessage(ResumingClientHandshaker.java:59)
at org.eclipse.californium.scandium.DTLSConnector.receiveNext(DTLSConnector.java:351)
at org.eclipse.californium.elements.ConnectorBase.receiveNextMessageFromNetwork(ConnectorBase.java:125)
at org.eclipse.californium.elements.ConnectorBase.access$200(ConnectorBase.java:36)
at org.eclipse.californium.elements.ConnectorBase$2.work(ConnectorBase.java:160)
at org.eclipse.californium.elements.ConnectorBase$Worker.run(ConnectorBase.java:219)
Φεβ 06, 2015 3:04:06 ΠΜ org.eclipse.californium.scandium.dtls.Handshaker processMessageNext
INFO: Discarded message from /192.168.2.9:5685 due to older epoch.
Φεβ 06, 2015 3:04:06 ΠΜ org.eclipse.californium.elements.ConnectorBase$Worker run
WARNING: Exception "java.lang.NullPointerException" in thread DTLS-Receiver-/192.168.2.2:5684
java.lang.NullPointerException
at org.eclipse.californium.scandium.dtls.Record.decryptFragment(Record.java:266)
at org.eclipse.californium.scandium.dtls.Record.getFragment(Record.java:535)
at org.eclipse.californium.scandium.dtls.Handshaker.processMessageNext(Handshaker.java:626)
at org.eclipse.californium.scandium.dtls.ResumingClientHandshaker.processMessage(ResumingClientHandshaker.java:59)
at org.eclipse.californium.scandium.DTLSConnector.receiveNext(DTLSConnector.java:351)
at org.eclipse.californium.elements.ConnectorBase.receiveNextMessageFromNetwork(ConnectorBase.java:125)
at org.eclipse.californium.elements.ConnectorBase.access$200(ConnectorBase.java:36)
at org.eclipse.californium.elements.ConnectorBase$2.work(ConnectorBase.java:160)
at org.eclipse.californium.elements.ConnectorBase$Worker.run(ConnectorBase.java:219)
Φεβ 06, 2015 3:04:06 ΠΜ org.eclipse.californium.scandium.dtls.Handshaker processMessageNext
INFO: Discarded message from /192.168.2.9:5685 due to older epoch.
Φεβ 06, 2015 3:04:06 ΠΜ org.eclipse.californium.elements.ConnectorBase$Worker run
WARNING: Exception "java.lang.NullPointerException" in thread DTLS-Receiver-/192.168.2.2:5684
java.lang.NullPointerException
at org.eclipse.californium.scandium.dtls.Record.decryptFragment(Record.java:266)
at org.eclipse.californium.scandium.dtls.Record.getFragment(Record.java:535)
at org.eclipse.californium.scandium.dtls.Handshaker.processMessageNext(Handshaker.java:626)
at org.eclipse.californium.scandium.dtls.ResumingClientHandshaker.processMessage(ResumingClientHandshaker.java:59)
at org.eclipse.californium.scandium.DTLSConnector.receiveNext(DTLSConnector.java:351)
at org.eclipse.californium.elements.ConnectorBase.receiveNextMessageFromNetwork(ConnectorBase.java:125)
at org.eclipse.californium.elements.ConnectorBase.access$200(ConnectorBase.java:36)
at org.eclipse.californium.elements.ConnectorBase$2.work(ConnectorBase.java:160)
at org.eclipse.californium.elements.ConnectorBase$Worker.run(ConnectorBase.java:219)
Φεβ 06, 2015 3:04:06 ΠΜ org.eclipse.californium.scandium.dtls.Handshaker processMessageNext
INFO: Discarded message from /192.168.2.9:5685 due to older epoch.
Φεβ 06, 2015 3:04:06 ΠΜ org.eclipse.californium.elements.ConnectorBase$Worker run
WARNING: Exception "java.lang.NullPointerException" in thread DTLS-Receiver-/192.168.2.2:5684
java.lang.NullPointerException
at org.eclipse.californium.scandium.dtls.Record.decryptFragment(Record.java:266)
at org.eclipse.californium.scandium.dtls.Record.getFragment(Record.java:535)
at org.eclipse.californium.scandium.dtls.Handshaker.processMessageNext(Handshaker.java:626)
at org.eclipse.californium.scandium.dtls.ResumingClientHandshaker.processMessage(ResumingClientHandshaker.java:59)
at org.eclipse.californium.scandium.DTLSConnector.receiveNext(DTLSConnector.java:351)
at org.eclipse.californium.elements.ConnectorBase.receiveNextMessageFromNetwork(ConnectorBase.java:125)
at org.eclipse.californium.elements.ConnectorBase.access$200(ConnectorBase.java:36)
at org.eclipse.californium.elements.ConnectorBase$2.work(ConnectorBase.java:160)
at org.eclipse.californium.elements.ConnectorBase$Worker.run(ConnectorBase.java:219)
Φεβ 06, 2015 3:04:06 ΠΜ org.eclipse.californium.scandium.dtls.Handshaker processMessageNext
INFO: Discarded message from /192.168.2.9:5685 due to older epoch.
Φεβ 06, 2015 3:04:06 ΠΜ org.eclipse.californium.elements.ConnectorBase$Worker run
WARNING: Exception "java.lang.NullPointerException" in thread DTLS-Receiver-/192.168.2.2:5684
java.lang.NullPointerException
at org.eclipse.californium.scandium.dtls.Record.decryptFragment(Record.java:266)
at org.eclipse.californium.scandium.dtls.Record.getFragment(Record.java:535)
at org.eclipse.californium.scandium.dtls.Handshaker.processMessageNext(Handshaker.java:626)
at org.eclipse.californium.scandium.dtls.ResumingClientHandshaker.processMessage(ResumingClientHandshaker.java:59)
at org.eclipse.californium.scandium.DTLSConnector.receiveNext(DTLSConnector.java:351)
at org.eclipse.californium.elements.ConnectorBase.receiveNextMessageFromNetwork(ConnectorBase.java:125)
at org.eclipse.californium.elements.ConnectorBase.access$200(ConnectorBase.java:36)
at org.eclipse.californium.elements.ConnectorBase$2.work(ConnectorBase.java:160)
at org.eclipse.californium.elements.ConnectorBase$Worker.run(ConnectorBase.java:219)
Φεβ 06, 2015 3:04:06 ΠΜ org.eclipse.californium.scandium.dtls.Handshaker processMessageNext
INFO: Discarded message from /192.168.2.9:5685 due to older epoch.
Φεβ 06, 2015 3:04:06 ΠΜ org.eclipse.californium.elements.ConnectorBase$Worker run
WARNING: Exception "java.lang.NullPointerException" in thread DTLS-Receiver-/192.168.2.2:5684
java.lang.NullPointerException
at org.eclipse.californium.scandium.dtls.Record.decryptFragment(Record.java:266)
at org.eclipse.californium.scandium.dtls.Record.getFragment(Record.java:535)
at org.eclipse.californium.scandium.dtls.Handshaker.processMessageNext(Handshaker.java:626)
at org.eclipse.californium.scandium.dtls.ResumingClientHandshaker.processMessage(ResumingClientHandshaker.java:59)
at org.eclipse.californium.scandium.DTLSConnector.receiveNext(DTLSConnector.java:351)
at org.eclipse.californium.elements.ConnectorBase.receiveNextMessageFromNetwork(ConnectorBase.java:125)
at org.eclipse.californium.elements.ConnectorBase.access$200(ConnectorBase.java:36)
at org.eclipse.californium.elements.ConnectorBase$2.work(ConnectorBase.java:160)
at org.eclipse.californium.elements.ConnectorBase$Worker.run(ConnectorBase.java:219)
Φεβ 06, 2015 3:04:06 ΠΜ org.eclipse.californium.scandium.dtls.Handshaker processMessageNext
INFO: Discarded message from /192.168.2.9:5685 due to older epoch.
Φεβ 06, 2015 3:04:06 ΠΜ org.eclipse.californium.elements.ConnectorBase$Worker run
WARNING: Exception "java.lang.NullPointerException" in thread DTLS-Receiver-/192.168.2.2:5684
java.lang.NullPointerException
at org.eclipse.californium.scandium.dtls.Record.decryptFragment(Record.java:266)
at org.eclipse.californium.scandium.dtls.Record.getFragment(Record.java:535)
at org.eclipse.californium.scandium.dtls.Handshaker.processMessageNext(Handshaker.java:626)
at org.eclipse.californium.scandium.dtls.ResumingClientHandshaker.processMessage(ResumingClientHandshaker.java:59)
at org.eclipse.californium.scandium.DTLSConnector.receiveNext(DTLSConnector.java:351)
at org.eclipse.californium.elements.ConnectorBase.receiveNextMessageFromNetwork(ConnectorBase.java:125)
at org.eclipse.californium.elements.ConnectorBase.access$200(ConnectorBase.java:36)
at org.eclipse.californium.elements.ConnectorBase$2.work(ConnectorBase.java:160)
at org.eclipse.californium.elements.ConnectorBase$Worker.run(ConnectorBase.java:219)
Φεβ 06, 2015 3:04:06 ΠΜ org.eclipse.californium.scandium.dtls.Handshaker processMessageNext
INFO: Discarded message from /192.168.2.9:5685 due to older epoch.
Φεβ 06, 2015 3:04:06 ΠΜ org.eclipse.californium.elements.ConnectorBase$Worker run
WARNING: Exception "java.lang.NullPointerException" in thread DTLS-Receiver-/192.168.2.2:5684
java.lang.NullPointerException
at org.eclipse.californium.scandium.dtls.Record.decryptFragment(Record.java:266)
at org.eclipse.californium.scandium.dtls.Record.getFragment(Record.java:535)
at org.eclipse.californium.scandium.dtls.Handshaker.processMessageNext(Handshaker.java:626)
at org.eclipse.californium.scandium.dtls.ResumingClientHandshaker.processMessage(ResumingClientHandshaker.java:59)
at org.eclipse.californium.scandium.DTLSConnector.receiveNext(DTLSConnector.java:351)
at org.eclipse.californium.elements.ConnectorBase.receiveNextMessageFromNetwork(ConnectorBase.java:125)
at org.eclipse.californium.elements.ConnectorBase.access$200(ConnectorBase.java:36)
at org.eclipse.californium.elements.ConnectorBase$2.work(ConnectorBase.java:160)
at org.eclipse.californium.elements.ConnectorBase$Worker.run(ConnectorBase.java:219)
Φεβ 06, 2015 3:04:06 ΠΜ org.eclipse.californium.scandium.dtls.Handshaker processMessageNext
INFO: Discarded message from /192.168.2.9:5685 due to older epoch.
Φεβ 06, 2015 3:04:06 ΠΜ org.eclipse.californium.elements.ConnectorBase$Worker run
WARNING: Exception "java.lang.NullPointerException" in thread DTLS-Receiver-/192.168.2.2:5684
java.lang.NullPointerException
at org.eclipse.californium.scandium.dtls.Record.decryptFragment(Record.java:266)
at org.eclipse.californium.scandium.dtls.Record.getFragment(Record.java:535)
at org.eclipse.californium.scandium.dtls.Handshaker.processMessageNext(Handshaker.java:626)
at org.eclipse.californium.scandium.dtls.ResumingClientHandshaker.processMessage(ResumingClientHandshaker.java:59)
at org.eclipse.californium.scandium.DTLSConnector.receiveNext(DTLSConnector.java:351)
at org.eclipse.californium.elements.ConnectorBase.receiveNextMessageFromNetwork(ConnectorBase.java:125)
at org.eclipse.californium.elements.ConnectorBase.access$200(ConnectorBase.java:36)
at org.eclipse.californium.elements.ConnectorBase$2.work(ConnectorBase.java:160)
at org.eclipse.californium.elements.ConnectorBase$Worker.run(ConnectorBase.java:219)
Φεβ 06, 2015 3:04:06 ΠΜ org.eclipse.californium.scandium.dtls.Handshaker processMessageNext
INFO: Discarded message from /192.168.2.9:5685 due to older epoch.
Φεβ 06, 2015 3:04:06 ΠΜ org.eclipse.californium.elements.ConnectorBase$Worker run
WARNING: Exception "java.lang.NullPointerException" in thread DTLS-Receiver-/192.168.2.2:5684
java.lang.NullPointerException
at org.eclipse.californium.scandium.dtls.Record.decryptFragment(Record.java:266)
at org.eclipse.californium.scandium.dtls.Record.getFragment(Record.java:535)
at org.eclipse.californium.scandium.dtls.Handshaker.processMessageNext(Handshaker.java:626)
at org.eclipse.californium.scandium.dtls.ResumingClientHandshaker.processMessage(ResumingClientHandshaker.java:59)
at org.eclipse.californium.scandium.DTLSConnector.receiveNext(DTLSConnector.java:351)
at org.eclipse.californium.elements.ConnectorBase.receiveNextMessageFromNetwork(ConnectorBase.java:125)
at org.eclipse.californium.elements.ConnectorBase.access$200(ConnectorBase.java:36)
at org.eclipse.californium.elements.ConnectorBase$2.work(ConnectorBase.java:160)
at org.eclipse.californium.elements.ConnectorBase$Worker.run(ConnectorBase.java:219)
Φεβ 06, 2015 3:04:06 ΠΜ org.eclipse.californium.scandium.dtls.Handshaker processMessageNext
INFO: Discarded message from /192.168.2.9:5685 due to older epoch.
Φεβ 06, 2015 3:04:06 ΠΜ org.eclipse.californium.elements.ConnectorBase$Worker run
WARNING: Exception "java.lang.NullPointerException" in thread DTLS-Receiver-/192.168.2.2:5684
java.lang.NullPointerException
at org.eclipse.californium.scandium.dtls.Record.decryptFragment(Record.java:266)
at org.eclipse.californium.scandium.dtls.Record.getFragment(Record.java:535)
at org.eclipse.californium.scandium.dtls.Handshaker.processMessageNext(Handshaker.java:626)
at org.eclipse.californium.scandium.dtls.ResumingClientHandshaker.processMessage(ResumingClientHandshaker.java:59)
at org.eclipse.californium.scandium.DTLSConnector.receiveNext(DTLSConnector.java:351)
at org.eclipse.californium.elements.ConnectorBase.receiveNextMessageFromNetwork(ConnectorBase.java:125)
at org.eclipse.californium.elements.ConnectorBase.access$200(ConnectorBase.java:36)
at org.eclipse.californium.elements.ConnectorBase$2.work(ConnectorBase.java:160)
at org.eclipse.californium.elements.ConnectorBase$Worker.run(ConnectorBase.java:219)
Φεβ 06, 2015 3:04:06 ΠΜ org.eclipse.californium.scandium.dtls.Handshaker processMessageNext
INFO: Discarded message from /192.168.2.9:5685 due to older epoch.
Φεβ 06, 2015 3:04:06 ΠΜ org.eclipse.californium.elements.ConnectorBase$Worker run
WARNING: Exception "java.lang.NullPointerException" in thread DTLS-Receiver-/192.168.2.2:5684
java.lang.NullPointerException
at org.eclipse.californium.scandium.dtls.Record.decryptFragment(Record.java:266)
at org.eclipse.californium.scandium.dtls.Record.getFragment(Record.java:535)
at org.eclipse.californium.scandium.dtls.Handshaker.processMessageNext(Handshaker.java:626)
at org.eclipse.californium.scandium.dtls.ResumingClientHandshaker.processMessage(ResumingClientHandshaker.java:59)
at org.eclipse.californium.scandium.DTLSConnector.receiveNext(DTLSConnector.java:351)
at org.eclipse.californium.elements.ConnectorBase.receiveNextMessageFromNetwork(ConnectorBase.java:125)
at org.eclipse.californium.elements.ConnectorBase.access$200(ConnectorBase.java:36)
at org.eclipse.californium.elements.ConnectorBase$2.work(ConnectorBase.java:160)
at org.eclipse.californium.elements.ConnectorBase$Worker.run(ConnectorBase.java:219)
Φεβ 06, 2015 3:04:06 ΠΜ org.eclipse.californium.scandium.dtls.Handshaker processMessageNext
INFO: Discarded message from /192.168.2.9:5685 due to older epoch.
Φεβ 06, 2015 3:04:06 ΠΜ org.eclipse.californium.elements.ConnectorBase$Worker run
WARNING: Exception "java.lang.NullPointerException" in thread DTLS-Receiver-/192.168.2.2:5684
java.lang.NullPointerException
at org.eclipse.californium.scandium.dtls.Record.decryptFragment(Record.java:266)
at org.eclipse.californium.scandium.dtls.Record.getFragment(Record.java:535)
at org.eclipse.californium.scandium.dtls.Handshaker.processMessageNext(Handshaker.java:626)
at org.eclipse.californium.scandium.dtls.ResumingClientHandshaker.processMessage(ResumingClientHandshaker.java:59)
at org.eclipse.californium.scandium.DTLSConnector.receiveNext(DTLSConnector.java:351)
at org.eclipse.californium.elements.ConnectorBase.receiveNextMessageFromNetwork(ConnectorBase.java:125)
at org.eclipse.californium.elements.ConnectorBase.access$200(ConnectorBase.java:36)
at org.eclipse.californium.elements.ConnectorBase$2.work(ConnectorBase.java:160)
at org.eclipse.californium.elements.ConnectorBase$Worker.run(ConnectorBase.java:219)
Φεβ 06, 2015 3:04:06 ΠΜ org.eclipse.californium.scandium.dtls.Handshaker processMessageNext
INFO: Discarded message from /192.168.2.9:5685 due to older epoch.
Φεβ 06, 2015 3:04:06 ΠΜ org.eclipse.californium.elements.ConnectorBase$Worker run
WARNING: Exception "java.lang.NullPointerException" in thread DTLS-Receiver-/192.168.2.2:5684
java.lang.NullPointerException
at org.eclipse.californium.scandium.dtls.Record.decryptFragment(Record.java:266)
at org.eclipse.californium.scandium.dtls.Record.getFragment(Record.java:535)
at org.eclipse.californium.scandium.dtls.Handshaker.processMessageNext(Handshaker.java:626)
at org.eclipse.californium.scandium.dtls.ResumingClientHandshaker.processMessage(ResumingClientHandshaker.java:59)
at org.eclipse.californium.scandium.DTLSConnector.receiveNext(DTLSConnector.java:351)
at org.eclipse.californium.elements.ConnectorBase.receiveNextMessageFromNetwork(ConnectorBase.java:125)
at org.eclipse.californium.elements.ConnectorBase.access$200(ConnectorBase.java:36)
at org.eclipse.californium.elements.ConnectorBase$2.work(ConnectorBase.java:160)
at org.eclipse.californium.elements.ConnectorBase$Worker.run(ConnectorBase.java:219)
Φεβ 06, 2015 3:04:07 ΠΜ org.eclipse.californium.elements.ConnectorBase$Worker run
WARNING: Exception "java.lang.NullPointerException" in thread DTLS-Sender-/192.168.2.2:5684
java.lang.NullPointerException
at org.eclipse.californium.scandium.dtls.CompressionMethod.listToByteArray(CompressionMethod.java:76)
at org.eclipse.californium.scandium.dtls.ClientHello.fragmentToByteArray(ClientHello.java:204)
at org.eclipse.californium.scandium.dtls.Handshaker.wrapMessage(Handshaker.java:566)
at org.eclipse.californium.scandium.dtls.ResumingClientHandshaker.getStartHandshakeMessage(ResumingClientHandshaker.java:187)
at org.eclipse.californium.scandium.DTLSConnector.sendNext(DTLSConnector.java:463)
at org.eclipse.californium.elements.ConnectorBase.sendNextMessageOverNetwork(ConnectorBase.java:140)
at org.eclipse.californium.elements.ConnectorBase.access$100(ConnectorBase.java:36)
at org.eclipse.californium.elements.ConnectorBase$1.work(ConnectorBase.java:156)
at org.eclipse.californium.elements.ConnectorBase$Worker.run(ConnectorBase.java:219)
Φεβ 06, 2015 3:04:09 ΠΜ org.eclipse.californium.scandium.dtls.Handshaker processMessageNext
INFO: Discarded message from /192.168.2.9:5685 due to older epoch.
Φεβ 06, 2015 3:04:09 ΠΜ org.eclipse.californium.elements.ConnectorBase$Worker run
WARNING: Exception "java.lang.NullPointerException" in thread DTLS-Receiver-/192.168.2.2:5684
java.lang.NullPointerException
at org.eclipse.californium.scandium.dtls.Record.decryptFragment(Record.java:266)
at org.eclipse.californium.scandium.dtls.Record.getFragment(Record.java:535)
at org.eclipse.californium.scandium.dtls.Handshaker.processMessageNext(Handshaker.java:626)
at org.eclipse.californium.scandium.dtls.ResumingClientHandshaker.processMessage(ResumingClientHandshaker.java:59)
at org.eclipse.californium.scandium.DTLSConnector.receiveNext(DTLSConnector.java:351)
at org.eclipse.californium.elements.ConnectorBase.receiveNextMessageFromNetwork(ConnectorBase.java:125)
at org.eclipse.californium.elements.ConnectorBase.access$200(ConnectorBase.java:36)
at org.eclipse.californium.elements.ConnectorBase$2.work(ConnectorBase.java:160)
at org.eclipse.californium.elements.ConnectorBase$Worker.run(ConnectorBase.java:219)
Φεβ 06, 2015 3:04:09 ΠΜ org.eclipse.californium.scandium.dtls.Handshaker processMessageNext
INFO: Discarded message from /192.168.2.9:5685 due to older epoch.
Φεβ 06, 2015 3:04:09 ΠΜ org.eclipse.californium.elements.ConnectorBase$Worker run
WARNING: Exception "java.lang.NullPointerException" in thread DTLS-Receiver-/192.168.2.2:5684
java.lang.NullPointerException
at org.eclipse.californium.scandium.dtls.Record.decryptFragment(Record.java:266)
at org.eclipse.californium.scandium.dtls.Record.getFragment(Record.java:535)
at org.eclipse.californium.scandium.dtls.Handshaker.processMessageNext(Handshaker.java:626)
at org.eclipse.californium.scandium.dtls.ResumingClientHandshaker.processMessage(ResumingClientHandshaker.java:59)
at org.eclipse.californium.scandium.DTLSConnector.receiveNext(DTLSConnector.java:351)
at org.eclipse.californium.elements.ConnectorBase.receiveNextMessageFromNetwork(ConnectorBase.java:125)
at org.eclipse.californium.elements.ConnectorBase.access$200(ConnectorBase.java:36)
at org.eclipse.californium.elements.ConnectorBase$2.work(ConnectorBase.java:160)
at org.eclipse.californium.elements.ConnectorBase$Worker.run(ConnectorBase.java:219)
Φεβ 06, 2015 3:04:09 ΠΜ org.eclipse.californium.scandium.dtls.Handshaker processMessageNext
INFO: Discarded message from /192.168.2.9:5685 due to older epoch.
Φεβ 06, 2015 3:04:09 ΠΜ org.eclipse.californium.elements.ConnectorBase$Worker run
WARNING: Exception "java.lang.NullPointerException" in thread DTLS-Receiver-/192.168.2.2:5684
java.lang.NullPointerException
at org.eclipse.californium.scandium.dtls.Record.decryptFragment(Record.java:266)
at org.eclipse.californium.scandium.dtls.Record.getFragment(Record.java:535)
at org.eclipse.californium.scandium.dtls.Handshaker.processMessageNext(Handshaker.java:626)
at org.eclipse.californium.scandium.dtls.ResumingClientHandshaker.processMessage(ResumingClientHandshaker.java:59)
at org.eclipse.californium.scandium.DTLSConnector.receiveNext(DTLSConnector.java:351)
at org.eclipse.californium.elements.ConnectorBase.receiveNextMessageFromNetwork(ConnectorBase.java:125)
at org.eclipse.californium.elements.ConnectorBase.access$200(ConnectorBase.java:36)
at org.eclipse.californium.elements.ConnectorBase$2.work(ConnectorBase.java:160)
at org.eclipse.californium.elements.ConnectorBase$Worker.run(ConnectorBase.java:219)
Φεβ 06, 2015 3:04:09 ΠΜ org.eclipse.californium.scandium.dtls.Handshaker processMessageNext
INFO: Discarded message from /192.168.2.9:5685 due to older epoch.
Φεβ 06, 2015 3:04:09 ΠΜ org.eclipse.californium.elements.ConnectorBase$Worker run
WARNING: Exception "java.lang.NullPointerException" in thread DTLS-Receiver-/192.168.2.2:5684
java.lang.NullPointerException
at org.eclipse.californium.scandium.dtls.Record.decryptFragment(Record.java:266)
at org.eclipse.californium.scandium.dtls.Record.getFragment(Record.java:535)
at org.eclipse.californium.scandium.dtls.Handshaker.processMessageNext(Handshaker.java:626)
at org.eclipse.californium.scandium.dtls.ResumingClientHandshaker.processMessage(ResumingClientHandshaker.java:59)
at org.eclipse.californium.scandium.DTLSConnector.receiveNext(DTLSConnector.java:351)
at org.eclipse.californium.elements.ConnectorBase.receiveNextMessageFromNetwork(ConnectorBase.java:125)
at org.eclipse.californium.elements.ConnectorBase.access$200(ConnectorBase.java:36)
at org.eclipse.californium.elements.ConnectorBase$2.work(ConnectorBase.java:160)
at org.eclipse.californium.elements.ConnectorBase$Worker.run(ConnectorBase.java:219)
Φεβ 06, 2015 3:04:09 ΠΜ org.eclipse.californium.scandium.dtls.Handshaker processMessageNext
INFO: Discarded message from /192.168.2.9:5685 due to older epoch.
Φεβ 06, 2015 3:04:09 ΠΜ org.eclipse.californium.elements.ConnectorBase$Worker run
WARNING: Exception "java.lang.NullPointerException" in thread DTLS-Receiver-/192.168.2.2:5684
java.lang.NullPointerException
at org.eclipse.californium.scandium.dtls.Record.decryptFragment(Record.java:266)
at org.eclipse.californium.scandium.dtls.Record.getFragment(Record.java:535)
at org.eclipse.californium.scandium.dtls.Handshaker.processMessageNext(Handshaker.java:626)
at org.eclipse.californium.scandium.dtls.ResumingClientHandshaker.processMessage(ResumingClientHandshaker.java:59)
at org.eclipse.californium.scandium.DTLSConnector.receiveNext(DTLSConnector.java:351)
at org.eclipse.californium.elements.ConnectorBase.receiveNextMessageFromNetwork(ConnectorBase.java:125)
at org.eclipse.californium.elements.ConnectorBase.access$200(ConnectorBase.java:36)
at org.eclipse.californium.elements.ConnectorBase$2.work(ConnectorBase.java:160)
at org.eclipse.californium.elements.ConnectorBase$Worker.run(ConnectorBase.java:219)
Φεβ 06, 2015 3:04:10 ΠΜ org.eclipse.californium.scandium.dtls.Handshaker processMessageNext
INFO: Discarded message from /192.168.2.9:5685 due to older epoch.
Φεβ 06, 2015 3:04:10 ΠΜ org.eclipse.californium.elements.ConnectorBase$Worker run
WARNING: Exception "java.lang.NullPointerException" in thread DTLS-Receiver-/192.168.2.2:5684
java.lang.NullPointerException
at org.eclipse.californium.scandium.dtls.Record.decryptFragment(Record.java:266)
at org.eclipse.californium.scandium.dtls.Record.getFragment(Record.java:535)
at org.eclipse.californium.scandium.dtls.Handshaker.processMessageNext(Handshaker.java:626)
at org.eclipse.californium.scandium.dtls.ResumingClientHandshaker.processMessage(ResumingClientHandshaker.java:59)
at org.eclipse.californium.scandium.DTLSConnector.receiveNext(DTLSConnector.java:351)
at org.eclipse.californium.elements.ConnectorBase.receiveNextMessageFromNetwork(ConnectorBase.java:125)
at org.eclipse.californium.elements.ConnectorBase.access$200(ConnectorBase.java:36)
at org.eclipse.californium.elements.ConnectorBase$2.work(ConnectorBase.java:160)
at org.eclipse.californium.elements.ConnectorBase$Worker.run(ConnectorBase.java:219)
Φεβ 06, 2015 3:04:15 ΠΜ org.eclipse.californium.elements.ConnectorBase$Worker run
WARNING: Exception "java.lang.NullPointerException" in thread DTLS-Sender-/192.168.2.2:5684
java.lang.NullPointerException
at org.eclipse.californium.scandium.dtls.CompressionMethod.listToByteArray(CompressionMethod.java:76)
at org.eclipse.californium.scandium.dtls.ClientHello.fragmentToByteArray(ClientHello.java:204)
at org.eclipse.californium.scandium.dtls.Handshaker.wrapMessage(Handshaker.java:566)
at org.eclipse.californium.scandium.dtls.ResumingClientHandshaker.getStartHandshakeMessage(ResumingClientHandshaker.java:187)
at org.eclipse.californium.scandium.DTLSConnector.sendNext(DTLSConnector.java:463)
at org.eclipse.californium.elements.ConnectorBase.sendNextMessageOverNetwork(ConnectorBase.java:140)
at org.eclipse.californium.elements.ConnectorBase.access$100(ConnectorBase.java:36)
at org.eclipse.californium.elements.ConnectorBase$1.work(ConnectorBase.java:156)
at org.eclipse.californium.elements.ConnectorBase$Worker.run(ConnectorBase.java:219)
Φεβ 06, 2015 3:04:17 ΠΜ org.eclipse.californium.scandium.dtls.Handshaker processMessageNext
INFO: Discarded message from /192.168.2.9:5685 due to older epoch.
Φεβ 06, 2015 3:04:17 ΠΜ org.eclipse.californium.elements.ConnectorBase$Worker run
WARNING: Exception "java.lang.NullPointerException" in thread DTLS-Receiver-/192.168.2.2:5684
java.lang.NullPointerException
at org.eclipse.californium.scandium.dtls.Record.decryptFragment(Record.java:266)
at org.eclipse.californium.scandium.dtls.Record.getFragment(Record.java:535)
at org.eclipse.californium.scandium.dtls.Handshaker.processMessageNext(Handshaker.java:626)
at org.eclipse.californium.scandium.dtls.ResumingClientHandshaker.processMessage(ResumingClientHandshaker.java:59)
at org.eclipse.californium.scandium.DTLSConnector.receiveNext(DTLSConnector.java:351)
at org.eclipse.californium.elements.ConnectorBase.receiveNextMessageFromNetwork(ConnectorBase.java:125)
at org.eclipse.californium.elements.ConnectorBase.access$200(ConnectorBase.java:36)
at org.eclipse.californium.elements.ConnectorBase$2.work(ConnectorBase.java:160)
at org.eclipse.californium.elements.ConnectorBase$Worker.run(ConnectorBase.java:219)
Φεβ 06, 2015 3:04:17 ΠΜ org.eclipse.californium.scandium.dtls.Handshaker processMessageNext
INFO: Discarded message from /192.168.2.9:5685 due to older epoch.
Φεβ 06, 2015 3:04:17 ΠΜ org.eclipse.californium.elements.ConnectorBase$Worker run
WARNING: Exception "java.lang.NullPointerException" in thread DTLS-Receiver-/192.168.2.2:5684
java.lang.NullPointerException
at org.eclipse.californium.scandium.dtls.Record.decryptFragment(Record.java:266)
at org.eclipse.californium.scandium.dtls.Record.getFragment(Record.java:535)
at org.eclipse.californium.scandium.dtls.Handshaker.processMessageNext(Handshaker.java:626)
at org.eclipse.californium.scandium.dtls.ResumingClientHandshaker.processMessage(ResumingClientHandshaker.java:59)
at org.eclipse.californium.scandium.DTLSConnector.receiveNext(DTLSConnector.java:351)
at org.eclipse.californium.elements.ConnectorBase.receiveNextMessageFromNetwork(ConnectorBase.java:125)
at org.eclipse.californium.elements.ConnectorBase.access$200(ConnectorBase.java:36)
at org.eclipse.californium.elements.ConnectorBase$2.work(ConnectorBase.java:160)
at org.eclipse.californium.elements.ConnectorBase$Worker.run(ConnectorBase.java:219)
Φεβ 06, 2015 3:04:17 ΠΜ org.eclipse.californium.scandium.dtls.Handshaker processMessageNext
INFO: Discarded message from /192.168.2.9:5685 due to older epoch.
Φεβ 06, 2015 3:04:17 ΠΜ org.eclipse.californium.elements.ConnectorBase$Worker run
WARNING: Exception "java.lang.NullPointerException" in thread DTLS-Receiver-/192.168.2.2:5684
java.lang.NullPointerException
at org.eclipse.californium.scandium.dtls.Record.decryptFragment(Record.java:266)
at org.eclipse.californium.scandium.dtls.Record.getFragment(Record.java:535)
at org.eclipse.californium.scandium.dtls.Handshaker.processMessageNext(Handshaker.java:626)
at org.eclipse.californium.scandium.dtls.ResumingClientHandshaker.processMessage(ResumingClientHandshaker.java:59)
at org.eclipse.californium.scandium.DTLSConnector.receiveNext(DTLSConnector.java:351)
at org.eclipse.californium.elements.ConnectorBase.receiveNextMessageFromNetwork(ConnectorBase.java:125)
at org.eclipse.californium.elements.ConnectorBase.access$200(ConnectorBase.java:36)
at org.eclipse.californium.elements.ConnectorBase$2.work(ConnectorBase.java:160)
at org.eclipse.californium.elements.ConnectorBase$Worker.run(ConnectorBase.java:219)
Φεβ 06, 2015 3:04:17 ΠΜ org.eclipse.californium.scandium.dtls.Handshaker processMessageNext
INFO: Discarded message from /192.168.2.9:5685 due to older epoch.
Φεβ 06, 2015 3:04:17 ΠΜ org.eclipse.californium.elements.ConnectorBase$Worker run
WARNING: Exception "java.lang.NullPointerException" in thread DTLS-Receiver-/192.168.2.2:5684
java.lang.NullPointerException
at org.eclipse.californium.scandium.dtls.Record.decryptFragment(Record.java:266)
at org.eclipse.californium.scandium.dtls.Record.getFragment(Record.java:535)
at org.eclipse.californium.scandium.dtls.Handshaker.processMessageNext(Handshaker.java:626)
at org.eclipse.californium.scandium.dtls.ResumingClientHandshaker.processMessage(ResumingClientHandshaker.java:59)
at org.eclipse.californium.scandium.DTLSConnector.receiveNext(DTLSConnector.java:351)
at org.eclipse.californium.elements.ConnectorBase.receiveNextMessageFromNetwork(ConnectorBase.java:125)
at org.eclipse.californium.elements.ConnectorBase.access$200(ConnectorBase.java:36)
at org.eclipse.californium.elements.ConnectorBase$2.work(ConnectorBase.java:160)
at org.eclipse.californium.elements.ConnectorBase$Worker.run(ConnectorBase.java:219)
Φεβ 06, 2015 3:04:17 ΠΜ org.eclipse.californium.scandium.dtls.Handshaker processMessageNext
INFO: Discarded message from /192.168.2.9:5685 due to older epoch.
Φεβ 06, 2015 3:04:17 ΠΜ org.eclipse.californium.elements.ConnectorBase$Worker run
WARNING: Exception "java.lang.NullPointerException" in thread DTLS-Receiver-/192.168.2.2:5684
java.lang.NullPointerException
at org.eclipse.californium.scandium.dtls.Record.decryptFragment(Record.java:266)
at org.eclipse.californium.scandium.dtls.Record.getFragment(Record.java:535)
at org.eclipse.californium.scandium.dtls.Handshaker.processMessageNext(Handshaker.java:626)
at org.eclipse.californium.scandium.dtls.ResumingClientHandshaker.processMessage(ResumingClientHandshaker.java:59)
at org.eclipse.californium.scandium.DTLSConnector.receiveNext(DTLSConnector.java:351)
at org.eclipse.californium.elements.ConnectorBase.receiveNextMessageFromNetwork(ConnectorBase.java:125)
at org.eclipse.californium.elements.ConnectorBase.access$200(ConnectorBase.java:36)
at org.eclipse.californium.elements.ConnectorBase$2.work(ConnectorBase.java:160)
at org.eclipse.californium.elements.ConnectorBase$Worker.run(ConnectorBase.java:219)
Φεβ 06, 2015 3:04:18 ΠΜ org.eclipse.californium.scandium.dtls.Handshaker processMessageNext
INFO: Discarded message from /192.168.2.9:5685 due to older epoch.
Φεβ 06, 2015 3:04:18 ΠΜ org.eclipse.californium.elements.ConnectorBase$Worker run
WARNING: Exception "java.lang.NullPointerException" in thread DTLS-Receiver-/192.168.2.2:5684
java.lang.NullPointerException
at org.eclipse.californium.scandium.dtls.Record.decryptFragment(Record.java:266)
at org.eclipse.californium.scandium.dtls.Record.getFragment(Record.java:535)
at org.eclipse.californium.scandium.dtls.Handshaker.processMessageNext(Handshaker.java:626)
at org.eclipse.californium.scandium.dtls.ResumingClientHandshaker.processMessage(ResumingClientHandshaker.java:59)
at org.eclipse.californium.scandium.DTLSConnector.receiveNext(DTLSConnector.java:351)
at org.eclipse.californium.elements.ConnectorBase.receiveNextMessageFromNetwork(ConnectorBase.java:125)
at org.eclipse.californium.elements.ConnectorBase.access$200(ConnectorBase.java:36)
at org.eclipse.californium.elements.ConnectorBase$2.work(ConnectorBase.java:160)
at org.eclipse.californium.elements.ConnectorBase$Worker.run(ConnectorBase.java:219)
Φεβ 06, 2015 3:04:32 ΠΜ org.eclipse.californium.elements.ConnectorBase$Worker run
WARNING: Exception "java.lang.NullPointerException" in thread DTLS-Sender-/192.168.2.2:5684
java.lang.NullPointerException
at org.eclipse.californium.scandium.dtls.CompressionMethod.listToByteArray(CompressionMethod.java:76)
at org.eclipse.californium.scandium.dtls.ClientHello.fragmentToByteArray(ClientHello.java:204)
at org.eclipse.californium.scandium.dtls.Handshaker.wrapMessage(Handshaker.java:566)
at org.eclipse.californium.scandium.dtls.ResumingClientHandshaker.getStartHandshakeMessage(ResumingClientHandshaker.java:187)
at org.eclipse.californium.scandium.DTLSConnector.sendNext(DTLSConnector.java:463)
at org.eclipse.californium.elements.ConnectorBase.sendNextMessageOverNetwork(ConnectorBase.java:140)
at org.eclipse.californium.elements.ConnectorBase.access$100(ConnectorBase.java:36)
at org.eclipse.californium.elements.ConnectorBase$1.work(ConnectorBase.java:156)
at org.eclipse.californium.elements.ConnectorBase$Worker.run(ConnectorBase.java:219)
i wanted to have an server and the client at the same instance so that is why i use different port than 5684
ps1 if i have an dtls server at port 5684 and a dtls client at port 5685 at the same machine they communicate without any problem.I can send you my code in order to check if i have done something wrong but the only thing that i change and it works is to change the port
ps2 if both the server and client are at the same port,different than 5684 it also works,this is how i finaly solved my both server and client problem at the same instance
Scandium must provide a better API to control DTLS from Californium and upper layers.
I started to work on session resumption. I create this issue to discuss about that.
My work is available in resume_session branch.
I focus on server side session resumption for now.
I made my tests with the gnutls-cli command line tools.
If you want to test the session resumption on ExampleDTLSServer.java with it, you could use :
./gnutls-cli -r -u --pskusername=Client_identity --pskkey=73656372657450534b --no-ca-verification localhost -p 5684 --priority NORMAL:-KX-ALL:+ECDHE-PSK:+DHE-PSK:+PSK
There is a recent bug fixed about PSK and session resumption, so you should probably get it directly from the gitlab repo. (or try with something else than PSK)
I investigated the problem and found that:
public ClientHello(ProtocolVersion version, SecureRandom secureRandom, DTLSSession session) {
this.clientVersion = version;
this.random = new Random(secureRandom);
this.sessionId = session.getSessionIdentifier();
System.out.println("ClientHello2: " + this.sessionId);
this.cookie = new Cookie();
addCipherSuite(session.getWriteState().getCipherSuite());
addCompressionMethod(session.getReadState().getCompressionMethod());
}
this.sessionId = session.getSessionIdentifier();
will set null because there were no communications with server.
I whold suggest to add:
if (this.sessionId == null)
this.sessionId = new SessionId(new byte[] {});
As a consumer of the scandium jar I would like to not have the examples embedded in the jar.
I see 2 way if doing that:
In the class ClientHandshaker in the method receivedServerHelloDone() under "case: PSK" the line
"clientKeyExchange = new PSKClientKeyExchange(psk);"
should read
"clientKeyExchange = new PSKClientKeyExchange(identity);"
public DtlsConnectorConfig build() method of org.eclipse.californium.scandium.config.DtlsConnectorConfig requires pskStore or private/public key pair. However, this is not necessary when setClientAuthenticationRequired(false) has been set in the server. If the checks are commented out. DTLS without client authentication works as expected.
The release version in 1.0.1 contains html file like about.html and other three.This html file also exists in
element-connector.When using both in Gradle(Android), this will result in build failure.
compile 'org.eclipse.californium:californium-core:1.0.1'
compile 'org.eclipse.californium:scandium:1.0.1'
compile 'org.eclipse.californium:element-connector:1.0.1'
To fix this,You have to add the following in android section
android {
//other code omitted
packagingOptions {
exclude 'META-INF/MANIFEST.MF'
exclude 'about.html'
exclude 'edl-v10.html'
exclude 'epl-v10.html'
exclude 'notice.html'
}
}
Please conside remove those html files in final release.
In my project I delay the flight 6 (server finished message) from the TinyDTLS constrained server. While, scandium is re-transmitting the flight 5 as it is supposed to do, from upper layer a new request arrives. In sendNext@DTLSConnector, since there is already a session, which is not active, a new ResumingClientHandshaker (RCH) is created. RCH overwrites the existing ClientHandshaker. The rest is disaster.
For the time being, in the sendNext method I simply ignore requests while there is already an ongoing flight. I am not sure what is the true action. May be the problem is the upper layer since it re-sends the request although I use blocking Coap interface as follows:
CoapClient client = new CoapClient(uri);
client.setEndpoint(new CoAPEndpoint(dtlsConnector, NetworkConfig.getStandard()));
client.setTimeout(0);
CoapResponse response = client.get();
ServerKeyExchange needs signature_algorithm field.
See RFC5246, section A.7. "Changes to RFC 4492"
Since I haven't made any modifications to the leshan implementation [0.1.11-M11-SNAPSHOT], as observed it holds the DTLS connection information into its heap memory and when ever the server is bounced the in memory connection objects get cleared and now I am not able to send any request to the client and I am getting a HANDSHAKE EXCEPTION.
How can i re initiate the handshake with the client or can we store the previous connection information for re-use.
When I do my pull request.
I don't find any java formatter rules to use.
It could be nice to add link to an eclipse formatter.xml file on the scandium main page.
You could also use maven-eclipse-plugin to download it automatically.
http://maven.apache.org/plugins/maven-eclipse-plugin/examples/load-code-styles.html
or even configure it automatically for scandium project only :
http://maven.apache.org/plugins/maven-eclipse-plugin/eclipse-mojo.html#additionalConfig
I see you commit, ".project" and ".classpath", if you don't care about committing eclipse files. An other solution is to commit ".settings" folder.
A commit to format all the code is also needed because several files contains mixed tabs/spaces indentation.
Hi,
Please could you specify where can I find the list of ciper suites supported in Scandium?
In particular, I'm looking for a DTLS solution that supports the following:
TLS_ECDH_ANON_WITH_AES_128_CBC_SHA256
TLS_ECDH_ANON_WITH_AES_256_CBC_SHA256
TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256
TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA256
TLS_PSK_DHE_WITH_AES_128_CCM_8
TLS_PSK_DHE_WITH_AES_128_CCM_8 (* 8 OCTET Authentication tag )
TLS_DHE_PSK_WITH_AES_128_CCM
TLS_DHE_PSK_WITH_AES_128_CCM ( 16 OCTET Authentication tag *)
TLS_DHE_PSK_WITH_AES_256_CCM
TLS_ECDHE_ECDSA_WITH_AES_128_CCM_8_SHA256
TLS_ECDHE_ECDSA_WITH_AES_128_CCM_SHA256
Regards,
Krzysztof
In DTLSConnector a unused session can be stuck forever in the session hashmap.
We should add an expiration date and a cleaning process.
Hi all,
I am using Californium and Scandium to provide CoAP servers and clients with DTLS and client authentication.
I set up a small PKI with a root CA and self-signed server as well as client certs. After I implemented a secure server (Thanks for the example) and client I tested the client authentication at the server side and it doesn't work. I used a wrong self-signed client cert. According to the following implementation in Scandium - CertificateMesssage.java:216, self-sigend certificates will be returned without verifying and throwing an Exception. So in my case the client with the wrong cert can establish a successful DTLS connection and is able to exchange data with the server. Do I anything wrong or is it a bug? I also comment the "return" then client authentication works.
Thanks in advance
Roland
public void verifyCertificate(Certificate[] trustedCertificates) throws HandshakeException {
if (isSelfSigned(peerCertificate)) {
// TODO allow self-signed certificates?
LOGGER.info("Peer used self-signed certificate.");
return;
}
verified = validateKeyChain(peerCertificate, certificateChain, trustedCertificates);
if (!verified) {
AlertMessage alert = new AlertMessage(AlertLevel.FATAL, AlertDescription.BAD_CERTIFICATE);
throw new HandshakeException("Certificate could not be verified.", alert);
}
}
if you look at the branch "client-not-working" there is a new test trying to start a server, a client and push message from the client to the server.
Pretty basic but it's really behaving like expected: it's spiing NPE in the ResumingClientHandshaker
1 INFO [DTLSConnector]: DLTS connector listening on 0.0.0.0/0.0.0.0:5684 - (org.eclipse.californium.scandium.DTLSConnector.java:160) start() in thread main at (2014-07-22 16:37:08)
juil. 22, 2014 4:37:08 PM org.eclipse.californium.elements.ConnectorBase$Worker run
INFOS: Start DTLS-Receiver0.0.0.0/0.0.0.0:5684, (running = true)
1 INFO [DTLSConnector]: DLTS connector listening on 0.0.0.0/0.0.0.0:5683 - (org.eclipse.californium.scandium.DTLSConnector.java:160) start() in thread main at (2014-07-22 16:37:08)
juil. 22, 2014 4:37:08 PM org.eclipse.californium.elements.ConnectorBase$Worker run
INFOS: Start DTLS-Sender0.0.0.0/0.0.0.0:5684, (running = true)
juil. 22, 2014 4:37:08 PM org.eclipse.californium.elements.ConnectorBase$Worker run
INFOS: Start DTLS-Sender0.0.0.0/0.0.0.0:5683, (running = true)
juil. 22, 2014 4:37:08 PM org.eclipse.californium.elements.ConnectorBase$Worker run
INFOS: Start DTLS-Receiver0.0.0.0/0.0.0.0:5683, (running = true)
15 FINE [DTLSConnector]: Sending message to localhost/127.0.0.1:5684 - (org.eclipse.californium.scandium.DTLSConnector.java:409) sendNext() in thread DTLS-Sender0.0.0.0/0.0.0.0:5683 at (2014-07-22 16:37:08)
15 FINEST [DTLSConnector]: Stored handshaker on send: org.eclipse.californium.scandium.dtls.ClientHandshaker@1ba1593 for localhost/127.0.0.1:5684 - (org.eclipse.californium.scandium.DTLSConnector.java:450) sendNext() in thread DTLS-Sender0.0.0.0/0.0.0.0:5683 at (2014-07-22 16:37:08)
14 FINEST [DTLSConnector]: => find handshaker for key /127.0.0.1:5683 - (org.eclipse.californium.scandium.DTLSConnector.java:184) receiveNext() in thread DTLS-Receiver0.0.0.0/0.0.0.0:5684 at (2014-07-22 16:37:08)
14 FINEST [DTLSConnector]: => contentType: Handshake (22) - (org.eclipse.californium.scandium.DTLSConnector.java:199) receiveNext() in thread DTLS-Receiver0.0.0.0/0.0.0.0:5684 at (2014-07-22 16:37:08)
14 FINEST [DTLSConnector]: => handshaker: null - (org.eclipse.californium.scandium.DTLSConnector.java:265) receiveNext() in thread DTLS-Receiver0.0.0.0/0.0.0.0:5684 at (2014-07-22 16:37:08)
14 INFO [DTLSConnector]: Created new session as server with peer: /127.0.0.1:5683 - (org.eclipse.californium.scandium.DTLSConnector.java:323) receiveNext() in thread DTLS-Receiver0.0.0.0/0.0.0.0:5684 at (2014-07-22 16:37:08)
15 FINE [DTLSConnector]: Sending message to localhost/127.0.0.1:5684 - (org.eclipse.californium.scandium.DTLSConnector.java:409) sendNext() in thread DTLS-Sender0.0.0.0/0.0.0.0:5683 at (2014-07-22 16:37:08)
14 FINEST [DTLSConnector]: Stored handshaker: org.eclipse.californium.scandium.dtls.ServerHandshaker@cc755a for /127.0.0.1:5683 - (org.eclipse.californium.scandium.DTLSConnector.java:331) receiveNext() in thread DTLS-Receiver0.0.0.0/0.0.0.0:5684 at (2014-07-22 16:37:08)
15 FINEST [DTLSConnector]: Stored handshaker on send: org.eclipse.californium.scandium.dtls.ResumingClientHandshaker@bdbb27 for localhost/127.0.0.1:5684 - (org.eclipse.californium.scandium.DTLSConnector.java:450) sendNext() in thread DTLS-Sender0.0.0.0/0.0.0.0:5683 at (2014-07-22 16:37:08)
juil. 22, 2014 4:37:08 PM org.eclipse.californium.elements.ConnectorBase$Worker run
AVERTISSEMENT: Exception "java.lang.NullPointerException" in thread DTLS-Sender0.0.0.0/0.0.0.0:5683: running=true
java.lang.NullPointerException
at org.eclipse.californium.scandium.dtls.ClientHello.fragmentToByteArray(ClientHello.java:208)
at org.eclipse.californium.scandium.dtls.Handshaker.wrapMessage(Handshaker.java:565)
at org.eclipse.californium.scandium.dtls.ResumingClientHandshaker.getStartHandshakeMessage(ResumingClientHandshaker.java:186)
at org.eclipse.californium.scandium.DTLSConnector.sendNext(DTLSConnector.java:452)
at org.eclipse.californium.elements.ConnectorBase.sendNextMessageOverNetwork(ConnectorBase.java:135)
at org.eclipse.californium.elements.ConnectorBase.access$100(ConnectorBase.java:36)
at org.eclipse.californium.elements.ConnectorBase$1.work(ConnectorBase.java:151)
at org.eclipse.californium.elements.ConnectorBase$Worker.run(ConnectorBase.java:226)
14 FINE [ServerHandshaker]: DTLS Message processed (/127.0.0.1:5683):
==[ DTLS Message ]============================================
Content Type: Handshake (22)
Version: 254, 253
Epoch: 0
Sequence Number: 0
Length: 89
Handshake Protocol
Type: Client Hello (1)
Message Sequence: 0
Fragment Offset: 0
Fragment Length: 77
Length: 77
Version: 254, 253
Random:
GMT Unix Time: Tue Jul 22 16:37:08 CEST 2014
Random Bytes: 07 BF 44 0A 5B 6A 67 AE ED 74 44 1C FD 2C B9 3D 9E 77 F4 BE 9A 24 F7 C8 5E 6A 8F 2E
Session ID Length: 0
Cookie Length: 0
Cipher Suites Length: 4
Cipher Suites (2 suites)
Cipher Suite: TLS_PSK_WITH_AES_128_CCM_8
Cipher Suite: TLS_ECDHE_ECDSA_WITH_AES_128_CCM_8
Compression Methods Length: 1
Compression Methods (1 method)
Compression Method: NULL
Extensions Length: 31
Extension: elliptic_curves (10)
Length: 8
Elliptic Curves Length: 6
Elliptic Curves (3 curves):
Elliptic Curve: secp256r1 (23)
Elliptic Curve: secp384r1 (24)
Elliptic Curve: secp521r1 (25)
Extension: ec_point_formats (11)
Length: 2
EC point formats length: 1
Elliptic Curves Point Formats (1):
EC point format: uncompressed (0)
Extension: client_certificate_type (19)
Client certificate type: RAW_PUBLIC_KEY
Extension: server_certificate_type (20)
Server certificate type: RAW_PUBLIC_KEY
Server certificate type: X_509
=============================================================== - (org.eclipse.californium.scandium.dtls.ServerHandshaker.java:237) processMessage() in thread DTLS-Receiver0.0.0.0/0.0.0.0:5684 at (2014-07-22 16:37:08)
16 FINEST [DTLSConnector]: => find handshaker for key /127.0.0.1:5684 - (org.eclipse.californium.scandium.DTLSConnector.java:184) receiveNext() in thread DTLS-Receiver0.0.0.0/0.0.0.0:5683 at (2014-07-22 16:37:08)
16 FINEST [DTLSConnector]: => contentType: Handshake (22) - (org.eclipse.californium.scandium.DTLSConnector.java:199) receiveNext() in thread DTLS-Receiver0.0.0.0/0.0.0.0:5683 at (2014-07-22 16:37:08)
16 FINEST [DTLSConnector]: => handshaker: org.eclipse.californium.scandium.dtls.ResumingClientHandshaker@bdbb27 - (org.eclipse.californium.scandium.DTLSConnector.java:265) receiveNext() in thread DTLS-Receiver0.0.0.0/0.0.0.0:5683 at (2014-07-22 16:37:08)
16 SEVERE [DTLSConnector]: Handshake Exception (/127.0.0.1:5684): Client received unexpected resuming handshake message:
Handshake Protocol
Type: Hello Verify Request (3)
Message Sequence: 0
Fragment Offset: 0
Fragment Length: 35
Length: 35
Server Version: 254, 253
Cookie Length: 32
Cookie: 71 5C CC D5 67 46 14 01 B2 91 5B 5D 6A 2B D6 26 26 BA 9F D1 F5 D2 CD E7 07 84 74 C9 02 96 53 37
(org.eclipse.californium.scandium.DTLSConnector.java:384) receiveNext() in thread DTLS-Receiver0.0.0.0/0.0.0.0:5683 at (2014-07-22 16:37:08)
16 SEVERE [DTLSConnector]: Datagram which lead to exception (/127.0.0.1:5684): 16 FE FD 00 00 00 00 00 00 00 00 00 2F 03 00 00 23 00 00 00 00 00 00 00 23 FE FD 20 71 5C CC D5 67 46 14 01 B2 91 5B 5D 6A 2B D6 26 26 BA 9F D1 F5 D2 CD E7 07 84 74 C9 02 96 53 37 - (org.eclipse.californium.scandium.DTLSConnector.java:390) receiveNext() in thread DTLS-Receiver0.0.0.0/0.0.0.0:5683 at (2014-07-22 16:37:08)
org.eclipse.californium.scandium.dtls.HandshakeException: Client received unexpected resuming handshake message:
Handshake Protocol
Type: Hello Verify Request (3)
Message Sequence: 0
Fragment Offset: 0
Fragment Length: 35
Length: 35
Server Version: 254, 253
Cookie Length: 32
Cookie: 71 5C CC D5 67 46 14 01 B2 91 5B 5D 6A 2B D6 26 26 BA 9F D1 F5 D2 CD E7 07 84 74 C9 02 96 53 37
at org.eclipse.californium.scandium.dtls.ResumingClientHandshaker.processMessage(ResumingClientHandshaker.java:88)
at org.eclipse.californium.scandium.DTLSConnector.receiveNext(DTLSConnector.java:340)
at org.eclipse.californium.elements.ConnectorBase.receiveNextMessageFromNetwork(ConnectorBase.java:120)
at org.eclipse.californium.elements.ConnectorBase.access$200(ConnectorBase.java:36)
at org.eclipse.californium.elements.ConnectorBase$2.work(ConnectorBase.java:155)
at org.eclipse.californium.elements.ConnectorBase$Worker.run(ConnectorBase.java:226)
14 FINEST [DTLSConnector]: => find handshaker for key /127.0.0.1:5683 - (org.eclipse.californium.scandium.DTLSConnector.java:184) receiveNext() in thread DTLS-Receiver0.0.0.0/0.0.0.0:5684 at (2014-07-22 16:37:08)
14 FINEST [DTLSConnector]: => contentType: Alert (21) - (org.eclipse.californium.scandium.DTLSConnector.java:199) receiveNext() in thread DTLS-Receiver0.0.0.0/0.0.0.0:5684 at (2014-07-22 16:37:08)
14 WARNING [DTLSConnector]: UNEXPECTED_MESSAGE with /127.0.0.1:5683 - (org.eclipse.californium.scandium.DTLSConnector.java:251) receiveNext() in thread DTLS-Receiver0.0.0.0/0.0.0.0:5684 at (2014-07-22 16:37:08)
15 FINE [DTLSConnector]: Sending message to localhost/127.0.0.1:5684 - (org.eclipse.californium.scandium.DTLSConnector.java:409) sendNext() in thread DTLS-Sender0.0.0.0/0.0.0.0:5683 at (2014-07-22 16:37:08)
15 FINEST [DTLSConnector]: Stored handshaker on send: org.eclipse.californium.scandium.dtls.ResumingClientHandshaker@32db7f for localhost/127.0.0.1:5684 - (org.eclipse.californium.scandium.DTLSConnector.java:450) sendNext() in thread DTLS-Sender0.0.0.0/0.0.0.0:5683 at (2014-07-22 16:37:08)
juil. 22, 2014 4:37:08 PM org.eclipse.californium.elements.ConnectorBase$Worker run
AVERTISSEMENT: Exception "java.lang.NullPointerException" in thread DTLS-Sender0.0.0.0/0.0.0.0:5683: running=true
java.lang.NullPointerException
at org.eclipse.californium.scandium.dtls.ClientHello.fragmentToByteArray(ClientHello.java:208)
at org.eclipse.californium.scandium.dtls.Handshaker.wrapMessage(Handshaker.java:565)
at org.eclipse.californium.scandium.dtls.ResumingClientHandshaker.getStartHandshakeMessage(ResumingClientHandshaker.java:186)
at org.eclipse.californium.scandium.DTLSConnector.sendNext(DTLSConnector.java:452)
at org.eclipse.californium.elements.ConnectorBase.sendNextMessageOverNetwork(ConnectorBase.java:135)
at org.eclipse.californium.elements.ConnectorBase.access$100(ConnectorBase.java:36)
at org.eclipse.californium.elements.ConnectorBase$1.work(ConnectorBase.java:151)
at org.eclipse.californium.elements.ConnectorBase$Worker.run(ConnectorBase.java:226)
15 FINE [DTLSConnector]: Sending message to localhost/127.0.0.1:5684 - (org.eclipse.californium.scandium.DTLSConnector.java:409) sendNext() in thread DTLS-Sender0.0.0.0/0.0.0.0:5683 at (2014-07-22 16:37:08)
15 FINEST [DTLSConnector]: Stored handshaker on send: org.eclipse.californium.scandium.dtls.ResumingClientHandshaker@121bf8a for localhost/127.0.0.1:5684 - (org.eclipse.californium.scandium.DTLSConnector.java:450) sendNext() in thread DTLS-Sender0.0.0.0/0.0.0.0:5683 at (2014-07-22 16:37:08)
juil. 22, 2014 4:37:08 PM org.eclipse.californium.elements.ConnectorBase$Worker run
AVERTISSEMENT: Exception "java.lang.NullPointerException" in thread DTLS-Sender0.0.0.0/0.0.0.0:5683: running=true
java.lang.NullPointerException
at org.eclipse.californium.scandium.dtls.ClientHello.fragmentToByteArray(ClientHello.java:208)
at org.eclipse.californium.scandium.dtls.Handshaker.wrapMessage(Handshaker.java:565)
at org.eclipse.californium.scandium.dtls.ResumingClientHandshaker.getStartHandshakeMessage(ResumingClientHandshaker.java:186)
at org.eclipse.californium.scandium.DTLSConnector.sendNext(DTLSConnector.java:452)
at org.eclipse.californium.elements.ConnectorBase.sendNextMessageOverNetwork(ConnectorBase.java:135)
at org.eclipse.californium.elements.ConnectorBase.access$100(ConnectorBase.java:36)
at org.eclipse.californium.elements.ConnectorBase$1.work(ConnectorBase.java:151)
at org.eclipse.californium.elements.ConnectorBase$Worker.run(ConnectorBase.java:226)
15 FINE [DTLSConnector]: Sending message to localhost/127.0.0.1:5684 - (org.eclipse.californium.scandium.DTLSConnector.java:409) sendNext() in thread DTLS-Sender0.0.0.0/0.0.0.0:5683 at (2014-07-22 16:37:08)
15 FINEST [DTLSConnector]: Stored handshaker on send: org.eclipse.californium.scandium.dtls.ResumingClientHandshaker@69f9a4 for localhost/127.0.0.1:5684 - (org.eclipse.californium.scandium.DTLSConnector.java:450) sendNext() in thread DTLS-Sender0.0.0.0/0.0.0.0:5683 at (2014-07-22 16:37:08)
juil. 22, 2014 4:37:08 PM org.eclipse.californium.elements.ConnectorBase$Worker run
AVERTISSEMENT: Exception "java.lang.NullPointerException" in thread DTLS-Sender0.0.0.0/0.0.0.0:5683: running=true
java.lang.NullPointerException
at org.eclipse.californium.scandium.dtls.ClientHello.fragmentToByteArray(ClientHello.java:208)
at org.eclipse.californium.scandium.dtls.Handshaker.wrapMessage(Handshaker.java:565)
at org.eclipse.californium.scandium.dtls.ResumingClientHandshaker.getStartHandshakeMessage(ResumingClientHandshaker.java:186)
at org.eclipse.californium.scandium.DTLSConnector.sendNext(DTLSConnector.java:452)
at org.eclipse.californium.elements.ConnectorBase.sendNextMessageOverNetwork(ConnectorBase.java:135)
at org.eclipse.californium.elements.ConnectorBase.access$100(ConnectorBase.java:36)
at org.eclipse.californium.elements.ConnectorBase$1.work(ConnectorBase.java:151)
at org.eclipse.californium.elements.ConnectorBase$Worker.run(ConnectorBase.java:226)
15 FINE [DTLSConnector]: Sending message to localhost/127.0.0.1:5684 - (org.eclipse.californium.scandium.DTLSConnector.java:409) sendNext() in thread DTLS-Sender0.0.0.0/0.0.0.0:5683 at (2014-07-22 16:37:09)
15 FINEST [DTLSConnector]: Stored handshaker on send: org.eclipse.californium.scandium.dtls.ResumingClientHandshaker@12a2272 for localhost/127.0.0.1:5684 - (org.eclipse.californium.scandium.DTLSConnector.java:450) sendNext() in thread DTLS-Sender0.0.0.0/0.0.0.0:5683 at (2014-07-22 16:37:09)
juil. 22, 2014 4:37:09 PM org.eclipse.californium.elements.ConnectorBase$Worker run
AVERTISSEMENT: Exception "java.lang.NullPointerException" in thread DTLS-Sender0.0.0.0/0.0.0.0:5683: running=true
java.lang.NullPointerException
at org.eclipse.californium.scandium.dtls.ClientHello.fragmentToByteArray(ClientHello.java:208)
at org.eclipse.californium.scandium.dtls.Handshaker.wrapMessage(Handshaker.java:565)
at org.eclipse.californium.scandium.dtls.ResumingClientHandshaker.getStartHandshakeMessage(ResumingClientHandshaker.java:186)
at org.eclipse.californium.scandium.DTLSConnector.sendNext(DTLSConnector.java:452)
at org.eclipse.californium.elements.ConnectorBase.sendNextMessageOverNetwork(ConnectorBase.java:135)
at org.eclipse.californium.elements.ConnectorBase.access$100(ConnectorBase.java:36)
at org.eclipse.californium.elements.ConnectorBase$1.work(ConnectorBase.java:151)
at org.eclipse.californium.elements.ConnectorBase$Worker.run(ConnectorBase.java:226)
I would like to test the SecureServer of the Californium project (https://github.com/eclipse/californium/blob/master/cf-secure/src/main/java/org/eclipse/californium/examples/SecureServer.java), is there a corresponding Client? If yes, could you provide it to me?
When a DTLS client loses its state while having an established session, it will start over with a new handshake. Scandium does not recognize this and tries to decrypt the ClientHello as application data.
The class RawPublicKeyIdentity imports javax.xml.bind.DatatypeComverter and uses it at line 59. Nevertheless this class does not exist in android and raises an exception when the library is used in this platform. I would suggest to remove this import and use at line 59 ByteArrayUtils.toHexString (ByteArrayUtils exists in package org.eclipse.californium.scandium.util)
I'm generating a pair of keys and certificate with the following :
keytool -genkeypair -alias coapserver -keyalg EC -keysize 256 -sigalg SHA256withECDSA -validity 365 -storetype JKS -keystore coapserver-keystore.jks -storepass python
keytool -export -alias coapserver -keystore coapserver-keystore.jks -file coapserver.crt
keytool -genkeypair -alias coapclient -keyalg EC -keysize 256 -sigalg SHA256withECDSA -validity 365 -storetype JKS -keystore coapclient-keystore.jks -storepass python
keytool -keystore coapclient-keystore.jks -import -alias coapserver -file coapserver.crt -trustcacerts
On my coap server :
KeyStore ks = KeyStore.getInstance ("JKS");
InputStream jksInputStream = new FileInputStream (new File (".").getAbsolutePath () + File.separator + "resources" + File.separator + "coapserver-keystore.jks");
ks.load (jksInputStream, "python".toCharArray ());
jksInputStream.close ();
KeyManagerFactory kmf = KeyManagerFactory.getInstance (KeyManagerFactory.getDefaultAlgorithm ());
kmf.init (ks, "python".toCharArray ());
TrustManagerFactory tmf = TrustManagerFactory.getInstance (TrustManagerFactory.getDefaultAlgorithm ());
tmf.init (ks);
DtlsConnectorConfig.Builder config = new DtlsConnectorConfig.Builder (new InetSocketAddress (COAPS_PORT));
config.setSupportedCipherSuites (
new CipherSuite [] {
CipherSuite.TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256
}
);
config.setIdentity (
(PrivateKey)ks.getKey ("coapserver", "python".toCharArray ()),
ks.getCertificateChain ("coapserver"),
true
);
DTLSConnector connector = new DTLSConnector (config.build());
addEndpoint (new CoapEndpoint (connector, NetworkConfig.getStandard ()));
On my client :
public SecureClient() {
try {
// load key store
KeyStore keyStore = KeyStore.getInstance ("JKS");
InputStream jksInputStream = new FileInputStream (new File (".").getAbsolutePath () + File.separator + "resources" + File.separator + "coapclient-keystore.jks");
keyStore.load (jksInputStream, "python".toCharArray ());
// You can load multiple certificates if needed
Certificate[] trustedCertificates = new Certificate [1];
trustedCertificates[0] = keyStore.getCertificate ("coapserver");
DtlsConnectorConfig.Builder builder = new DtlsConnectorConfig.Builder (new InetSocketAddress (0));
builder.setIdentity (
(PrivateKey)keyStore.getKey ("coapclient", "python".toCharArray ()),
keyStore.getCertificateChain ("coapclient"),
true
);
builder.setTrustStore (trustedCertificates);
dtlsConnector = new DTLSConnector (builder.build ());
} catch (Exception e) {
System.err.println ("Could not load the keystore");
e.printStackTrace ();
}
}
public void test () {
URI uri = null;
String u = "coaps://localhost/houses/house1";
try {
uri = new URI (u);
} catch (URISyntaxException e) {
System.err.println ("Invalid URI: " + e.getMessage());
System.exit (-1);
}
CoapClient client = new CoapClient (uri);
client.setEndpoint (new CoapEndpoint (dtlsConnector, NetworkConfig.getStandard ()));
CoapResponse response = client.get ();
if (response != null) {
System.out.println (response.getCode ());
System.out.println (response.getOptions ());
System.out.println (response.getResponseText ());
System.out.println ("\nADVANCED\n");
System.out.println (Utils.prettyPrint (response));
} else {
System.out.println ("No response received.");
}
try {
dtlsConnector.start ();
} catch (IOException e) {
e.printStackTrace ();
}
}
public static void main (String[] args) throws InterruptedException {
SecureClient client = new SecureClient ();
client.test ();
synchronized (SecureClient.class) {
SecureClient.class.wait ();
}
}
So my issue, is when I consume the resources through unsecure coap
everything is fine.
But when I consume the resources through coaps
I get no response on the client and this is what I get on the client :
14 FINE [DTLSConnector]: Received Handshake (22) record from peer [/127.0.0.1:5684] - (org.eclipse.californium.scandium.DTLSConnector.java:455) processHandshakeRecord() in thread DTLS-Receiver-0.0.0.0/0.0.0.0:53719 at (2016-06-08 23:40:26)
14 FINE [Record]: Parsing message without a session - (org.eclipse.californium.scandium.dtls.Record.java:830) decryptHandshakeMessage() in thread DTLS-Receiver-0.0.0.0/0.0.0.0:53719 at (2016-06-08 23:40:26)
14 FINE [DTLSConnector]: Received Handshake (22) record from peer [/127.0.0.1:5684] - (org.eclipse.californium.scandium.DTLSConnector.java:455) processHandshakeRecord() in thread DTLS-Receiver-0.0.0.0/0.0.0.0:53719 at (2016-06-08 23:40:26)
14 FINE [Record]: Parsing message without a session - (org.eclipse.californium.scandium.dtls.Record.java:830) decryptHandshakeMessage() in thread DTLS-Receiver-0.0.0.0/0.0.0.0:53719 at (2016-06-08 23:40:26)
14 FINE [DTLSConnector]: Discarding unexpected CERTIFICATE_REQUEST (13) message from peer [/127.0.0.1:5684] - (org.eclipse.californium.scandium.DTLSConnector.java:722) processHandshakeRecordWithoutConnection() in thread DTLS-Receiver-0.0.0.0/0.0.0.0:53719 at (2016-06-08 23:40:26)
14 FINE [DTLSConnector]: Received Handshake (22) record from peer [/127.0.0.1:5684] - (org.eclipse.californium.scandium.DTLSConnector.java:455) processHandshakeRecord() in thread DTLS-Receiver-0.0.0.0/0.0.0.0:53719 at (2016-06-08 23:40:26)
14 FINE [Record]: Parsing message without a session - (org.eclipse.californium.scandium.dtls.Record.java:830) decryptHandshakeMessage() in thread DTLS-Receiver-0.0.0.0/0.0.0.0:53719 at (2016-06-08 23:40:26)
14 FINE [DTLSConnector]: Discarding unexpected SERVER_HELLO_DONE (14) message from peer [/127.0.0.1:5684] - (org.eclipse.californium.scandium.DTLSConnector.java:722) processHandshakeRecordWithoutConnection() in thread DTLS-Receiver-0.0.0.0/0.0.0.0:53719 at (2016-06-08 23:40:26)
14 FINE [DTLSConnector]: Received Handshake (22) record from peer [/127.0.0.1:5684] - (org.eclipse.californium.scandium.DTLSConnector.java:455) processHandshakeRecord() in thread DTLS-Receiver-0.0.0.0/0.0.0.0:53719 at (2016-06-08 23:40:26)
14 FINE [Record]: Parsing message without a session - (org.eclipse.californium.scandium.dtls.Record.java:830) decryptHandshakeMessage() in thread DTLS-Receiver-0.0.0.0/0.0.0.0:53719 at (2016-06-08 23:40:26)
And sometimes :
14 INFO [DTLSConnector]: Unexpected error occurred while processing record from peer [/127.0.0.1:5684] - (org.eclipse.californium.scandium.DTLSConnector.java:464) receiveNextDatagramFromNetwork() in thread DTLS-Receiver-0.0.0.0/0.0.0.0:54907 at (2016-06-08 23:43:26)
java.lang.ArrayIndexOutOfBoundsException: 0
at org.eclipse.californium.scandium.dtls.ClientHandshaker.receivedServerCertificate(ClientHandshaker.java:378)
at org.eclipse.californium.scandium.dtls.ClientHandshaker.doProcessMessage(ClientHandshaker.java:210)
at org.eclipse.californium.scandium.dtls.Handshaker.processMessage(Handshaker.java:372)
at org.eclipse.californium.scandium.DTLSConnector.processOngoingHandshakeMessage(DTLSConnector.java:817)
at org.eclipse.californium.scandium.DTLSConnector.processDecryptedHandshakeMessage(DTLSConnector.java:804)
at org.eclipse.californium.scandium.DTLSConnector.processHandshakeRecordWithConnection(DTLSConnector.java:788)
at org.eclipse.californium.scandium.DTLSConnector.processHandshakeRecord(DTLSConnector.java:724)
at org.eclipse.californium.scandium.DTLSConnector.receiveNextDatagramFromNetwork(DTLSConnector.java:455)
at org.eclipse.californium.scandium.DTLSConnector.access$100(DTLSConnector.java:112)
at org.eclipse.californium.scandium.DTLSConnector$3.doWork(DTLSConnector.java:357)
at org.eclipse.californium.scandium.DTLSConnector$Worker.run(DTLSConnector.java:1521)
14 FINE [DTLSConnector]: Terminating connection with peer [localhost/127.0.0.1:5684], reason [INTERNAL_ERROR] - (org.eclipse.californium.scandium.DTLSConnector.java:537) terminateConnection() in thread DTLS-Receiver-0.0.0.0/0.0.0.0:54907 at (2016-06-08 23:43:26)
15 FINE [DTLSConnector]: Re-transmitting flight for [localhost/127.0.0.1:5684], [3] retransmissions left
Am I doing something wrong or is this a bug?
Thanks.
@cburger-scheidlin reported:
DTLS supports negotiation of cipher suites in the handshake. Therefore the client will typically list all supported cipher suites in the Client Hello message. Obviously, Scandium is not expected to support all cipher suites offered by the client. However, CipherSuite.getTypeByCode(int code) returns SSL_NULL_WITH_NULL_NULL for an unknown cipher suite. This in turn will lead to the bytes 0x0000 representing the cipher suite and finally to an incorrect calculation of the handshake hash.
I think there are two possible ways to fix this. Either make Scandium aware of all existing cipher suites and maintain this list, or turn CipherSuite into a class that can store the code for unknown cipher suites and thus fix the handshake calculation problem
When messages are out of order, they are queued. Assume that in Flight 4, ServerKeyExchange is lost, and CertificateRequest arrives out of order. Later, when ServerKeyExchange arrives with ServerHelloDone in a retransmission of the whole flight, Scandium does not go through the QueuedMessages before handling ServerHelloDone.
As a result, Scandium thinks that there was no certificateRequest, so this is a PSK based session.
So the solution should be emptying the QueuedMessages before handling the ServerHelloDone.
after a call to DTLSConnector::close(InetSocketAddress peerAdress) the session is not removed from the list of dtls sessions.
If someone reconnected later using the same source ip/port the old session will be reused.
To close a DTLS session sender can send a close_notify message and receiver MUST reply with a close_notify. RFC6012
In Scandium, it seems close_notify is sent only if we are considered as "a client". See DTLSConnector.
I think if (!session.isClient())
should be removed.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.