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

ERROR during connecting via PSK #814

Closed
Maher9494 opened this issue Feb 21, 2020 · 7 comments
Closed

ERROR during connecting via PSK #814

Maher9494 opened this issue Feb 21, 2020 · 7 comments
Labels
question Any question about leshan

Comments

@Maher9494
Copy link

Maher9494 commented Feb 21, 2020

Greetings,
I'm using Quectel BC66-NA, and I'm trying to connect to the LWM2M server via PSK. The connection is being dropped during the DTLS handshaking with error code 40.
I've checked the available ciphers in both the server and the module as referenced in #650 and I've found that the cipher TLS_PSK_WITH_AES_128_CBC_SHA256 is common cipher between the module and the server !
This was my wireshark log :

wireshark.zip

Thanks in advance

@sbernard31
Copy link
Contributor

By default CBC is not activated because this cipher is not really consider as safe enough now.
Maybe we should activate it for demo 🤔

I will look at your capture deeply on Monday.

@sbernard31 sbernard31 added the question Any question about leshan label Feb 21, 2020
@Maher9494
Copy link
Author

Thanks a lot ... I'll really appreciate your help 😄

@sbernard31
Copy link
Contributor

I looked at your capture and I confirm that your device only propose "deprecated" cipher suite based on "unsecured" CBC.

So the solution is to allow more secure cipher at device side (based on GCM,CCM or CCM8) like : TLS_PSK_WITH_AES_128_CCM_8.

Or enable old cipher in leshan, currently there is no other way than modifying the code.
But I can add a new argument to leshan-server-demo to allow "deprecated cipher suite".

If you prefer modify directly the code, this should looks like this:

LeshanServerBuilder serverBuilder = new LeshanServerBuilder();
Builder dtlsConfig = new DtlsConnectorConfig.Builder();
dtlsConfig.setRecommendedCipherSuitesOnly(false);
builder.setDtlsConfig(dtlsConfig);
LeshanServer server = serverBuilder.build();

@sbernard31
Copy link
Contributor

sbernard31 commented Feb 24, 2020

I created a new PR with a new "oc" option to enable "old" cipher suites : #815.

If you can tell me if it works for you 🙏

@Maher9494
Copy link
Author

Thanks a lot for the help it's working perfectly now 😄

@sbernard31
Copy link
Contributor

So we can close this issue ? :)

@Maher9494
Copy link
Author

Yes sure, thanks again :)

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

No branches or pull requests

2 participants