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

chore!: update dtls2 package to version 0.18.0 #200

Merged
merged 1 commit into from
Dec 11, 2024

Conversation

JKRhb
Copy link
Contributor

@JKRhb JKRhb commented Dec 11, 2024

This PR updates the dtls2 package to the latest version. Since there have been API changes in dtls2 regarding the handling of certificates, the relevant parts of the API for this package are modified accordingly and the certificate classes in question are re-exported.

The main benefit of this change is now that you are able to provide root certificates that can also be in PEM format, making the use of DTLS in PKI mode a bit more versatile and the API itself clearer. However, as there are API changes involved, they have to be considered breaking changes.

@JKRhb JKRhb changed the title chore!: update dtls2 package chore!: update dtls2 package to version 0.18.0 Dec 11, 2024
@shamblett shamblett merged commit aaa4765 into shamblett:master Dec 11, 2024
4 checks passed
@shamblett
Copy link
Owner

Getting some analysis errors on merge -

error: The name 'Certificate' isn't a type, so it can't be used as a type argument. (non_type_as_type_argument at [coap] lib/src/network/coap_network_openssl.dart:61)
error: The name 'Certificate' isn't a type, so it can't be used as a type argument. (non_type_as_type_argument at [coap] lib/src/network/coap_network_openssl.dart:81)
warning: The library 'package:dtls2/dtls2.dart' doesn't export a member with the shown name 'Certificate'. (undefined_shown_name at [coap] lib/coap.dart:11)
warning: The library 'package:dtls2/dtls2.dart' doesn't export a member with the shown name 'PemCertificate'. (undefined_shown_name at [coap] lib/coap.dart:11)
warning: The library 'package:dtls2/dtls2.dart' doesn't export a member with the shown name 'DerCertificate'. (undefined_shown_name at [coap] lib/coap.dart:11)

@JKRhb JKRhb deleted the pem-certificates branch December 11, 2024 11:06
@JKRhb
Copy link
Contributor Author

JKRhb commented Dec 11, 2024

Thank you for merging and your comment! Are you getting these errors locally or in the CI?

@shamblett
Copy link
Owner

Hi,

Locally in my IDE(Intellij) appeared as soon as I merged into master.

@JKRhb
Copy link
Contributor Author

JKRhb commented Dec 11, 2024

Hi,

Locally in my IDE(Intellij) appeared as soon as I merged into master.

Hmm, that is strange, I cannot reproduce it on my machine, and the CI seems also fine – do you maybe need to rerun dart pub get and/or delete the pubspec.lock file?

@shamblett
Copy link
Owner

Ah yes, needed a pub get! I wish it would remind me of this when I pull an updated pubspec.yaml.

@shamblett
Copy link
Owner

Running example get_resource_secure.dart gives -

Sending get /test to californium.eclipseprojects.io
CoAP encountered an exception: DtlsException: No ciphers available. If you are using PSK cipher suites, check you have defined a pskCredentialsCallback.

Probably just needs an update for the DTLS changes.

@JKRhb
Copy link
Contributor Author

JKRhb commented Dec 12, 2024

Thank you for pointing that out! I think it is actually related to recent changes in OpenSSL which cause the cipher suite that is defined in the example to only be usable when reducing the "security level". I've already implemented a way to adjust the security level in dtls2, for which I will create a PR here shortly.

@shamblett
Copy link
Owner

Great thanks.

@JKRhb
Copy link
Contributor Author

JKRhb commented Dec 12, 2024

#203 should now provide a fix for this issue :)

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