rust: allow TLS configuration with client cert#559
Open
nbuffon wants to merge 1 commit into
Open
Conversation
Signed-off-by: Nicolas Buffon <nicolas.buffon@orange.com>
tigroo
requested changes
Jul 10, 2026
tigroo
left a comment
Collaborator
There was a problem hiding this comment.
code ok. Test ko: no logs receive, no error trace:
/home/kvmk8371/.cargo/bin/cargo run --color=always --package libits-client --example json_counter --profile dev -- --config examples/htw-config.ini
Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.16s
Running `target/debug/examples/json_counter --config examples/htw-config.ini`
INFO [libits::client::logger] Logger ready on stdout
INFO [libits::transport::mqtt] Configuring TLS with client certificate (MQTTS)
INFO [libits::transport::mqtt::mqtt_router] Registered route for topic: #
DEBUG [libits::transport::mqtt::mqtt_client] Sent subscriptions
DEBUG [rustls::webpki::anchors] add_parsable_certificates processed 1 valid and 0 invalid certs
DEBUG [rustls::client::hs] No cached session for DnsName("fgvt-fw1.htwsaar.de")
DEBUG [rustls::client::hs] Not resuming any session
DEBUG [rustls::client::hs] Using ciphersuite TLS13_AES_256_GCM_SHA384
DEBUG [rustls::client::tls13] Not resuming
DEBUG [rustls::client::tls13] TLS1.3 encrypted extensions: []
DEBUG [rustls::client::hs] ALPN protocol is None
DEBUG [rustls::client::tls13] Got CertificateRequest CertificateRequestPayloadTls13 { context: , extensions: [SignatureAlgorithms([ECDSA_NISTP256_SHA256, ECDSA_NISTP384_SHA384, ECDSA_NISTP521_SHA512, ED25519, ED448, Unknown(2057), Unknown(2058), Unknown(2059), RSA_PSS_SHA256, RSA_PSS_SHA384, RSA_PSS_SHA512, RSA_PKCS1_SHA256, RSA_PKCS1_SHA384, RSA_PKCS1_SHA512, Unknown(771), Unknown(769)]), AuthorityNames([DistinguishedName(308187310b30090603550406130244453111300f06035504080c08536161726c616e643110300e060355040a0c0768747773616172310d300b060355040b0c04464756543117301506035504030c0e4647565420446576696365204341312b302906092a864886f70d010901161c6d617474686961732e7363686f6c74657340687477736161722e6465), DistinguishedName(30819c310b30090603550406130244453111300f06035504080c08536161726c616e643115301306035504070c0c5361617262727565636b656e3110300e060355040a0c0768747773616172310d300b060355040b0c04464756543115301306035504030c0c4647565420526f6f74204341312b302906092a864886f70d010901161c6d617474686961732e7363686f6c74657340687477736161722e6465)])] }
DEBUG [rustls::client::common] Attempting client auth
DEBUG [rumqttc::v5::state] Subscribe. Topics = [Filter { path: "#", qos: AtMostOnce, nolocal: false, preserve_retain: false, retain_forward_rule: OnEverySubscribe }], Pkid = 1
DEBUG [rumqttc::v5::state] SubAck Pkid = 1, QoS = AtMostOnce
DEBUG [rumqttc::v5::state] Pingreq, last incoming packet before 12.178578ms, last outgoing request before 60.000804783s
tigroo
approved these changes
Jul 10, 2026
tigroo
left a comment
Collaborator
There was a problem hiding this comment.
In fact, waiting 1000 messages instead of 10....it arrives!
Received 1000 messages including 989 as JSON
DEBUG [rumqttc::v5::state] Pingreq, last incoming packet before 184.496016ms, last outgoing request before 60.001049475s
DEBUG [rumqttc::v5::state] Pingreq, last incoming packet before 38.19714ms, last outgoing request before 60.000738554s
DEBUG [rumqttc::v5::state] Pingreq, last incoming packet before 625.203963ms, last outgoing request before 60.000866031s
DEBUG [rumqttc::v5::state] Pingreq, last incoming packet before 643.885008ms, last outgoing request before 60.001562233s
DEBUG [rumqttc::v5::state] Pingreq, last incoming packet before 159.382277ms, last outgoing request before 60.001933928s
Received 2000 messages including 1979 as JSON
DEBUG [rumqttc::v5::state] Pingreq, last incoming packet before 559.930673ms, last outgoing request before 60.001894081s
DEBUG [rumqttc::v5::state] Pingreq, last incoming packet before 163.309095ms, last outgoing request before 60.002105408s
DEBUG [rumqttc::v5::state] Pingreq, last incoming packet before 95.429916ms, last outgoing request before 60.001487659s
DEBUG [rumqttc::v5::state] Pingreq, last incoming packet before 652.051911ms, last outgoing request before 60.000979966s
DEBUG [rumqttc::v5::state] Pingreq, last incoming packet before 612.221475ms, last outgoing request before 60.001446875s
DEBUG [rumqttc::v5::state] Pingreq, last incoming packet before 198.559726ms, last outgoing request before 60.001919131s
Received 3000 messages including 2967 as JSON
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What's new
How to test
examples/config.ini) to point to a broker requiring client certificatejson_counterexample