Skip to content

Added support for device certificate chain in leshan-lwm2m-client module #1708

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

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

jakubsobolewskisag
Copy link
Contributor

@jakubsobolewskisag jakubsobolewskisag commented Apr 2, 2025

PR Description

LwM2m 1.2 specification allows devices to send/use X.509 certificate chains in the Security object and therefore in communication with LwM2m servers (and bootstrap servers). To prepare for this, Leshan client library can already use certificate chains in a backwards-compatible way. This change allows client implementations to use certificate chains.

@sbernard31
Copy link
Contributor

Thx for the PR.
As this is a bit out of scope, I created an issue to discuss about that : #1710

@sbernard31
Copy link
Contributor

I pushed some more code to limit usage of DER encoding by default.
The code should allow to provide custom ServersInfoExtractor for Client and ConfigurationChecker for Bootstrap Server.

I will probably add some more commit to clean old code following sonar advice (I prefer to do that separately to keep commit readable).

Maybe out of scope of that PR :

  • Maybe it would make sense to create a utility class for Tests to handle certificates/files in src/test/resouces
  • ServersInfoExtractor it is now dynamic but I need to double check if the way we access to it is OK 🤔
  • I also notice that there is a problem in objectTree with objectEnabler initialization using LwM2mObjectTree.addObjectEnabler(LwM2mObjectEnabler). It seems that enabler.init(client, linkFormatHelper, serversInfoExtractor); is not called and I think it should (I need to double check that)
  • some constructor have too much arguments we should find a way to make this cleaner.

I will be out of office next week back Tuesday 21th.

@sbernard31 sbernard31 force-pushed the client-x509-chain-support branch from 1cb21cd to 6c7095d Compare April 24, 2025 07:43
@sbernard31
Copy link
Contributor

I did :

  • Maybe it would make sense to create a utility class for Tests to handle certificates/files in src/test/resouces

For that ones, I will do that in another PR :

  • ServersInfoExtractor it is now dynamic but I need to double check if the way we access to it is OK 🤔
  • I also notice that there is a problem in objectTree with objectEnabler initialization using LwM2mObjectTree.addObjectEnabler(LwM2mObjectEnabler). It seems that enabler.init(client, linkFormatHelper, serversInfoExtractor); is not called and I think it should (I need to double check that)
  • some constructor have too much arguments we should find a way to make this cleaner.

@jakubsobolewskisag, if you want you can review this PR and test if that solves your issue.

@sbernard31
Copy link
Contributor

sbernard31 commented Apr 24, 2025

(ignore the legal agreements issue, I suspect that eclipse infra is partially down)

@sbernard31
Copy link
Contributor

sbernard31 commented Apr 25, 2025

@jakubsobolewskisag finally I also did :

  • ServersInfoExtractor it is now dynamic but I need to double check if the way we access to it is OK 🤔
  • I also notice that there is a problem in objectTree with objectEnabler initialization using LwM2mObjectTree.addObjectEnabler(LwM2mObjectEnabler). It seems that enabler.init(client, linkFormatHelper, serversInfoExtractor); is not called and I think it should (I need to double check that)

in this PR.

Note that for first point, I slip ServersInfoExtractor in an interface + default implementation and a static class ObjectTreeReader. (better seperation of concerns)

I don't touch anything more until I get you feeback 🙂

@jakubsobolewskisag
Copy link
Contributor Author

@sbernard31 Thank you! I will check that next week, since I'm on PTO now ;)

@sbernard31 sbernard31 force-pushed the client-x509-chain-support branch from 7e43111 to be2343c Compare April 30, 2025 12:42
@sbernard31
Copy link
Contributor

(Please note that I will be unavailable for most of the month, so replies may be delayed 😅 )

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

Successfully merging this pull request may close these issues.

2 participants