Skip to content

Commit

Permalink
feat(binding_coap): add support for PEM root certificates
Browse files Browse the repository at this point in the history
  • Loading branch information
JKRhb committed Dec 12, 2024
1 parent b180edb commit f3aac37
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
3 changes: 3 additions & 0 deletions lib/binding_coap.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
/// [spec link]: https://www.w3.org/TR/wot-binding-templates/
library binding_coap;

export "package:coap/coap.dart"
show Certificate, DerCertificate, PemCertificate;

export "src/binding_coap/coap_client_factory.dart";
export "src/binding_coap/coap_config.dart";
export "src/binding_coap/coap_server.dart";
3 changes: 1 addition & 2 deletions lib/src/binding_coap/coap_client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
// SPDX-License-Identifier: BSD-3-Clause

import "dart:async";
import "dart:typed_data";

import "package:coap/coap.dart" as coap;
import "package:coap/config/coap_config_default.dart";
Expand Down Expand Up @@ -41,7 +40,7 @@ class _InternalCoapConfig extends CoapConfigDefault {
final bool dtlsWithTrustedRoots;

@override
final List<Uint8List> rootCertificates;
final List<coap.Certificate> rootCertificates;
}

coap.PskCredentialsCallback? _createPskCallback(
Expand Down
5 changes: 2 additions & 3 deletions lib/src/binding_coap/coap_config.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
//
// SPDX-License-Identifier: BSD-3-Clause

import "dart:typed_data";

import "package:coap/coap.dart";
import "package:meta/meta.dart";

/// Allows for configuring the behavior of CoAP clients and servers.
Expand Down Expand Up @@ -34,7 +33,7 @@ class CoapConfig {
final String? dtlsCiphers;

/// List of custom root certificates to use with OpenSSL.
final List<Uint8List> rootCertificates;
final List<Certificate> rootCertificates;

/// The port number used by a client or server. Defaults to 5683.
final int port;
Expand Down
6 changes: 6 additions & 0 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,9 @@ dependencies:
typed_data: ^1.3.2
uri: ^1.0.0
uuid: ^4.2.1

dependency_overrides:
coap:
git:
url: https://github.com/namib-project/coap
ref: dtls2-security-level

0 comments on commit f3aac37

Please sign in to comment.