Skip to content

Commit fcc451b

Browse files
committed
fixup! feat(binding-coap): add support for client certificates
1 parent 35ec99c commit fcc451b

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

lib/src/binding_coap/coap_client.dart

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class _InternalCoapConfig extends CoapConfigDefault {
2929
rootCertificates = coapConfig.rootCertificates,
3030
clientCertificateFileName = coapConfig.clientCertificateFileName,
3131
clientKeyFileName = coapConfig.clientKeyFileName,
32-
verifyPrivateKey = coapConfig.verifyPrivateKey;
32+
_verifyPrivateKey = coapConfig.verifyPrivateKey;
3333

3434
@override
3535
final int preferredBlockSize;
@@ -52,8 +52,10 @@ class _InternalCoapConfig extends CoapConfigDefault {
5252
@override
5353
final String? clientKeyFileName;
5454

55+
final bool _verifyPrivateKey;
56+
5557
@override
56-
final bool verifyPrivateKey;
58+
bool get verifyPrivateKey => _verifyPrivateKey;
5759
}
5860

5961
coap.PskCredentialsCallback? _createPskCallback(

lib/src/binding_coap/coap_config.dart

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,13 @@ class CoapConfig {
6161
/// Defaults to 60 seconds.
6262
final Duration multicastDiscoveryTimeout;
6363

64+
/// Name of a file referring to a client certificate used with DTLS PKI mode.
6465
final String? clientCertificateFileName;
66+
67+
/// Name of a file referring to a private client key used with DTLS PKI mode.
6568
final String? clientKeyFileName;
69+
70+
/// Whether the private key of the client certificate should be verified when
71+
/// creating the DTLS context.
6672
final bool verifyPrivateKey;
6773
}

0 commit comments

Comments
 (0)