-
Notifications
You must be signed in to change notification settings - Fork 423
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
One-way DTLS Handshake Succeeds Even Without -R trust_casfile. Expected behaviour? #1592
Comments
Yes. As you are not defining any certificates, the OpenSSL client logic generates its own certificates.
As no certificates are defined, it has no way of validating the server certificate as no root servers are defined, so the logic allows this to continue.
You need to provide the client with suitable PKI certificates that both the client and server can work with. It is possible at the (liboap using) server end to continue working with client certificates it does not like (including the internally generated client certificates), but that requires server certificates to be provided and the use of the |
Hi @mrdeep1, Thanks for the update. As I understand it, this behavior is due to how libcoap interacts with OpenSSL in this scenario. I would like to clarify:
|
None of them do for the client. The
Yes, because the system's default trust store is not loaded (as provided by ca-certificates package for example on Ubuntu)
I will get the man page updated to be clearer. Back in time, someone requested that they wanted the client to be able to connect to a PKI enabled server, but without any PKI certificates provided. The question about the client validating the server's certificate did not come up then, but using the I agree that nowadays trust is important. Not every CoAP environment will want the default trust store loaded - especially closed systems with little RAM. I need to think how best to implement loading trust store without breaking any API. |
@mrdeep1, thanks for all of these clarifications. This explanation helps a lot in understanding the current behavior of libcoap with OpenSSL and the reasoning behind it. Would you like to keep this issue open to track the potential implementation of loading the trust store without breaking any API, or should it be closed for now? Looking forward to your thoughts. |
I would leave this open for now. As a comment, |
Environment
libcoap Configuration Summary:
Problem Description
According to the coap-client-openssl man page:
From this description, I would expect that if -R is not provided, the DTLS handshake should fail because the server's certificate cannot be verified.
Actual Behavior
When running the following command without -R:
I get the following output:
Despite these warnings, the handshake continues successfully:
Questions
The text was updated successfully, but these errors were encountered: