Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LWM2M with DTLS and PSK #114

Open
sonny82 opened this issue Aug 27, 2021 · 0 comments
Open

LWM2M with DTLS and PSK #114

sonny82 opened this issue Aug 27, 2021 · 0 comments

Comments

@sonny82
Copy link

sonny82 commented Aug 27, 2021

Hi,

I'm trying to use LWM2M plugin with DTLS and PSK in version 4.3.7 but without any success.
In emqx.conf I commented out listener.ssl.external.ciphers and uncommented listener.ssl.external.psk_ciphers.
I enabled the emqx_psk_file plugin.
In psk.txt file I entered my client id and key (myclientId:C127D993068150012D74863733313864F26932C7E707E724A479BBA730580538).
In emqx_lwm2m.conf I commented out lwm2m.dtls.ciphers and uncommented lwm2m.dtls.psk_ciphers.
Then I restarted EMQX.

Now if I try to connect using leshan client I get the following exception:

2021-08-27 16:29:51,735 INFO LeshanClientDemo - DTLS Full Handshake initiated by client : STARTED ...
2021-08-27 16:29:51,750 INFO DefaultRegistrationEngine - Unable to send register request : Received 'fatal alert/INSUFFICIENT_SECURITY'
2021-08-27 16:29:51,750 INFO LeshanClientDemo - DTLS Full Handshake initiated by client : FAILED (Received 'fatal alert/INSUFFICIENT_SECURITY')

Leshan client command that I use:
java -jar .\leshan-client-demo.jar -n myclientId -u localhost:5684 -i myclientId -p C127D993068150012D74863733313864F26932C7E707E724A479BBA730580538

In the log file I can see:

2021-08-27T16:44:04.480000+02:00 [notice] DTLS server: In state hello at dtls_handshake.erl:194 generated SERVER ALERT: Fatal - Insufficient Security
2021-08-27T16:44:04.480000+02:00 [error] supervisor: 'esockd_connection_sup - <0.442.0>', errorContext: connection_shutdown, reason: {ssl_error,{tls_alert,{insufficient_security,"DTLS server: In state hello at dtls_handshake.erl:194 generated SERVER ALERT: Fatal - Insufficient Security\n"}}}, offender: [{pid,<0.1333.0>},{name,connection},{mfargs,{lwm2m_coap_channel,start_link,[[{lifetime_max,86400},{lifetime_min,1},{mountpoint,<<"lwm2m/%e/">>},{port,5683},{auto_observe,false},{qmode_time_window,0},{update_msg_publish_condition,contains_object_list},{topics,[...]}]]}}]

Could you please help me, I don't find any more help in the docu..

Thank you in advance and best regards,
Sonny

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant