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

Support authentication of devices using X.509 certificates in the CoAP adapter #2099

Closed
mostafa-eltaher opened this issue Aug 4, 2020 · 9 comments
Assignees
Labels
CoAP Adapter Feature Request A request for adding new functionality to Hono
Milestone

Comments

@mostafa-eltaher
Copy link

The CoAP adapter should support devices using an X.509 client certificate for authenticating.

@sophokles73 sophokles73 added CoAP Adapter Feature Request A request for adding new functionality to Hono help wanted Issues that we would welcome any help from (new) contributors with labels Aug 4, 2020
@sophokles73
Copy link
Contributor

I would suggest to also include support for raw public keys in this issue.

@boaks
Copy link
Contributor

boaks commented Aug 10, 2020

x509 - PR #816

"Long ago", I tried to implement it. In the meantime, the hono code base changed a lot, so I'm not sure, if that contains still useful ideas.

RPK - Issue #733

Contains some ideas about RPK.

For both, x509 and RPK, the validation in Californium is currently still "blocking/sync", so I'm not sure, if the validation could be postponed into the "naturally" none-blocking forwarding of the message.

@sophokles73
Copy link
Contributor

@boaks

x509 - PR #816

"Long ago", I tried to implement it. In the meantime, the hono code base changed a lot, so I'm not sure, if that contains still useful ideas.

I took a look at your PR and I believe that it basically does the right thing(s). It would need to be adapted to the current state of the CoAP adapter but in general it looks quite good. Would you like to give it another shot?

@boaks
Copy link
Contributor

boaks commented Aug 14, 2020

I guess, that I will not have time for it until the end of this year ;-(.

@sophokles73
Copy link
Contributor

@boaks Then how about I give it a shot? I can rebase and adapt to current CoAP adapter. WDYT?

@boaks
Copy link
Contributor

boaks commented Aug 15, 2020

Sounds good.

@boaks
Copy link
Contributor

boaks commented Sep 2, 2020

@sophokles73
@mostafa-eltaher

I started to implement a "none blocking" CertificateVerifier and RPK lookup. That's only the first step to get an initial support. The steps for handling multiple server certificates based on DNS/SNI or signature algorithms are not planned from my side for now. Also steps to make the "session cache" really cluster ready, are not planned (see Evolving the SessionCache ).

FMPOV, using expensive crypto-functions as x509 should therefore also use CID. Hopefully with the cid-load-balancing the cluster topic will be sorted out.

I hope, that approach works for you.

@boaks
Copy link
Contributor

boaks commented Sep 4, 2020

@sophokles73

I created a first PR for x.509 in californium which also supports a custom argument may be used for the device id.

About RPK support:
Does hono support a "credentials store" per tenant? If so it will be hard for RPK, because the RPK doesn't contain more information than its "global unique public key". If it's OK to do a "global credentials lookup", I will add the none blocking support for RPK next week as well.

@boaks
Copy link
Contributor

boaks commented Apr 27, 2021

I prepared a first PR #2629, which introduces x509 (again).

@sophokles73 sophokles73 added this to the 1.8.0 milestone Apr 27, 2021
@sophokles73 sophokles73 removed the help wanted Issues that we would welcome any help from (new) contributors with label Apr 27, 2021
sophokles73 pushed a commit that referenced this issue Apr 28, 2021
Adapt callback custom argument from String to AdditionalInfo to support
both PSK and x509.
Introduce DeviceInfoSupplier as common callback for PSK and x509.

Signed-off-by: Achim Kraus <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CoAP Adapter Feature Request A request for adding new functionality to Hono
Projects
None yet
Development

No branches or pull requests

3 participants