rumqttc over native-tls, not rustls

b4b277e · Gabriel Morell · 2026-10-23 15:57

8 files +129 -279
Message
{commit_body(@commit)}

Files changed

modified .github/workflows/rust-ci.yml
+16 −14
@@ -30,18 +30,19 @@ jobs:
30 30 - name: Install system dependencies (Linux)
31 31 if: runner.os == 'Linux'
32 32 run: |
33 − # Nothing here links a C library -- rumqttc speaks rustls and zbus
34 − # is pure Rust -- so a linker and pkg-config are all a bare
35 − # self-hosted container is missing.
33 + # rumqttc does TLS through native-tls, which links the system
34 + # OpenSSL (found with pkg-config); zbus is pure Rust. So a linker,
35 + # pkg-config and the OpenSSL headers are what a bare self-hosted
36 + # container is missing.
36 37 if command -v apt-get &> /dev/null; then
37 38 sudo apt-get update
38 − sudo apt-get install -y build-essential pkg-config
39 + sudo apt-get install -y build-essential pkg-config libssl-dev
39 40 elif command -v dnf &> /dev/null; then
40 − sudo dnf install -y gcc pkgconfig
41 + sudo dnf install -y gcc pkgconfig openssl-devel
41 42 elif command -v yum &> /dev/null; then
42 − sudo yum install -y gcc pkgconfig
43 + sudo yum install -y gcc pkgconfig openssl-devel
43 44 else
44 − echo "Package manager not found. Please install a C toolchain and pkg-config manually."
45 + echo "Package manager not found. Please install a C toolchain, pkg-config and the OpenSSL headers manually."
45 46 exit 1
46 47 fi
47 48
@@ -250,18 +251,19 @@ jobs:
250 251
251 252 - name: Install system dependencies
252 253 run: |
253 − # Nothing here links a C library -- rumqttc speaks rustls and zbus
254 − # is pure Rust -- so a linker and pkg-config are all a bare
255 − # self-hosted container is missing.
254 + # rumqttc does TLS through native-tls, which links the system
255 + # OpenSSL (found with pkg-config); zbus is pure Rust. So a linker,
256 + # pkg-config and the OpenSSL headers are what a bare self-hosted
257 + # container is missing.
256 258 if command -v apt-get &> /dev/null; then
257 259 sudo apt-get update
258 − sudo apt-get install -y build-essential pkg-config
260 + sudo apt-get install -y build-essential pkg-config libssl-dev
259 261 elif command -v dnf &> /dev/null; then
260 − sudo dnf install -y gcc pkgconfig
262 + sudo dnf install -y gcc pkgconfig openssl-devel
261 263 elif command -v yum &> /dev/null; then
262 − sudo yum install -y gcc pkgconfig
264 + sudo yum install -y gcc pkgconfig openssl-devel
263 265 else
264 − echo "Package manager not found. Please install a C toolchain and pkg-config manually."
266 + echo "Package manager not found. Please install a C toolchain, pkg-config and the OpenSSL headers manually."
265 267 exit 1
266 268 fi
267 269
modified Cargo.lock
+95 −262
@@ -47,7 +47,7 @@ version = "1.1.5"
47 47 source = "registry+https://github.com/rust-lang/crates.io-index"
48 48 checksum = "40c48f72fd53cd289104fc64099abca73db4166ad86ea0b4341abe65af83dadc"
49 49 dependencies = [
50 − "windows-sys 0.61.2",
50 + "windows-sys",
51 51 ]
52 52
53 53 [[package]]
@@ -58,7 +58,7 @@ checksum = "291e6a250ff86cd4a820112fb8898808a366d8f9f58ce16d1f538353ad55747d"
58 58 dependencies = [
59 59 "anstyle",
60 60 "once_cell_polyfill",
61 − "windows-sys 0.61.2",
61 + "windows-sys",
62 62 ]
63 63
64 64 [[package]]
@@ -114,29 +114,6 @@ version = "1.5.1"
114 114 source = "registry+https://github.com/rust-lang/crates.io-index"
115 115 checksum = "f2032f911046de80f0a198e0901378627c33f59ea0ac00e363d481118bd70a53"
116 116
117 −[[package]]
118 −name = "aws-lc-rs"
119 −version = "1.18.1"
120 −source = "registry+https://github.com/rust-lang/crates.io-index"
121 −checksum = "b281d307588d634de920874890732659e2e7672f72b5e10e81badc1a8a83621e"
122 −dependencies = [
123 − "aws-lc-sys",
124 − "zeroize",
125 −]
126 −
127 −[[package]]
128 −name = "aws-lc-sys"
129 −version = "0.45.0"
130 −source = "registry+https://github.com/rust-lang/crates.io-index"
131 −checksum = "9bff6c3b54fad79a2e60b8102caf565819711497c1f5f092f49508e2f5c31b27"
132 −dependencies = [
133 − "cc",
134 − "cmake",
135 − "dunce",
136 − "fs_extra",
137 − "pkg-config",
138 −]
139 −
140 117 [[package]]
141 118 name = "bitflags"
142 119 version = "2.13.2"
@@ -162,8 +139,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
162 139 checksum = "f74872d07caf508b30a21f6836e7d7016a2eaf7d9ff4f48deaa58cd8a0407630"
163 140 dependencies = [
164 141 "find-msvc-tools",
165 − "jobserver",
166 − "libc",
167 142 "shlex",
168 143 ]
169 144
@@ -213,15 +188,6 @@ version = "1.1.1"
213 188 source = "registry+https://github.com/rust-lang/crates.io-index"
214 189 checksum = "1c133bc6a41be0d194c306b5506d15e6feeea7b1d6604bd3f8310dfb2ca96486"
215 190
216 −[[package]]
217 −name = "cmake"
218 −version = "0.1.58"
219 −source = "registry+https://github.com/rust-lang/crates.io-index"
220 −checksum = "c0f78a02292a74a88ac736019ab962ece0bc380e3f977bf72e376c5d78ff0678"
221 −dependencies = [
222 − "cc",
223 −]
224 −
225 191 [[package]]
226 192 name = "colorchoice"
227 193 version = "1.0.5"
@@ -262,7 +228,7 @@ dependencies = [
262 228 "libc",
263 229 "option-ext",
264 230 "redox_users",
265 − "windows-sys 0.61.2",
231 + "windows-sys",
266 232 ]
267 233
268 234 [[package]]
@@ -276,12 +242,6 @@ dependencies = [
276 242 "syn 3.0.6",
277 243 ]
278 244
279 −[[package]]
280 −name = "dunce"
281 −version = "1.0.5"
282 −source = "registry+https://github.com/rust-lang/crates.io-index"
283 −checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813"
284 −
285 245 [[package]]
286 246 name = "endi"
287 247 version = "1.1.1"
@@ -301,7 +261,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
301 261 checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb"
302 262 dependencies = [
303 263 "libc",
304 − "windows-sys 0.61.2",
264 + "windows-sys",
305 265 ]
306 266
307 267 [[package]]
@@ -333,6 +293,21 @@ dependencies = [
333 293 "spin",
334 294 ]
335 295
296 +[[package]]
297 +name = "foreign-types"
298 +version = "0.3.2"
299 +source = "registry+https://github.com/rust-lang/crates.io-index"
300 +checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1"
301 +dependencies = [
302 + "foreign-types-shared",
303 +]
304 +
305 +[[package]]
306 +name = "foreign-types-shared"
307 +version = "0.1.1"
308 +source = "registry+https://github.com/rust-lang/crates.io-index"
309 +checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b"
310 +
336 311 [[package]]
337 312 name = "form_urlencoded"
338 313 version = "1.2.2"
@@ -342,12 +317,6 @@ dependencies = [
342 317 "percent-encoding",
343 318 ]
344 319
345 −[[package]]
346 −name = "fs_extra"
347 −version = "1.3.0"
348 −source = "registry+https://github.com/rust-lang/crates.io-index"
349 −checksum = "42703706b716c37f96a77aea830392ad231f44c9e9a67872fa5548707e11b11c"
350 −
351 320 [[package]]
352 321 name = "futures-core"
353 322 version = "0.3.34"
@@ -395,17 +364,6 @@ dependencies = [
395 364 "windows-link",
396 365 ]
397 366
398 −[[package]]
399 −name = "getrandom"
400 −version = "0.2.17"
401 −source = "registry+https://github.com/rust-lang/crates.io-index"
402 −checksum = "ff2abc00be7fca6ebc474524697ae276ad847ad0a6b3faa4bcb027e9a4614ad0"
403 −dependencies = [
404 − "cfg-if",
405 − "libc",
406 − "wasi",
407 −]
408 −
409 367 [[package]]
410 368 name = "getrandom"
411 369 version = "0.4.3"
@@ -561,16 +519,6 @@ version = "1.0.18"
561 519 source = "registry+https://github.com/rust-lang/crates.io-index"
562 520 checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682"
563 521
564 −[[package]]
565 −name = "jobserver"
566 −version = "0.1.35"
567 −source = "registry+https://github.com/rust-lang/crates.io-index"
568 −checksum = "1c00acbd29eabad4a2392fa0e921c874934dbbf4194312ad20f04a0ed67a3cb3"
569 −dependencies = [
570 − "getrandom 0.4.3",
571 − "libc",
572 −]
573 −
574 522 [[package]]
575 523 name = "js-sys"
576 524 version = "0.3.106"
@@ -662,7 +610,24 @@ checksum = "1788edb87fdc09c7e26304471e2f5be8cdefb1b6930d6e3985fc02ff53bf86ee"
662 610 dependencies = [
663 611 "libc",
664 612 "wasi",
665 − "windows-sys 0.61.2",
613 + "windows-sys",
614 +]
615 +
616 +[[package]]
617 +name = "native-tls"
618 +version = "0.2.18"
619 +source = "registry+https://github.com/rust-lang/crates.io-index"
620 +checksum = "465500e14ea162429d264d44189adc38b199b62b1c21eea9f69e4b73cb03bbf2"
621 +dependencies = [
622 + "libc",
623 + "log",
624 + "openssl",
625 + "openssl-probe",
626 + "openssl-sys",
627 + "schannel",
628 + "security-framework",
629 + "security-framework-sys",
630 + "tempfile",
666 631 ]
667 632
668 633 [[package]]
@@ -671,7 +636,7 @@ version = "0.50.3"
671 636 source = "registry+https://github.com/rust-lang/crates.io-index"
672 637 checksum = "7957b9740744892f114936ab4a57b3f487491bbeafaf8083688b16841a4240e5"
673 638 dependencies = [
674 − "windows-sys 0.61.2",
639 + "windows-sys",
675 640 ]
676 641
677 642 [[package]]
@@ -686,12 +651,49 @@ version = "1.70.2"
686 651 source = "registry+https://github.com/rust-lang/crates.io-index"
687 652 checksum = "384b8ab6d37215f3c5301a95a4accb5d64aa607f1fcb26a11b5303878451b4fe"
688 653
654 +[[package]]
655 +name = "openssl"
656 +version = "0.10.81"
657 +source = "registry+https://github.com/rust-lang/crates.io-index"
658 +checksum = "77823a27f0babb03091cb9ed9ef80af3b39dbc82f97e8fa530374b7dafd87a45"
659 +dependencies = [
660 + "bitflags",
661 + "cfg-if",
662 + "foreign-types",
663 + "libc",
664 + "openssl-macros",
665 + "openssl-sys",
666 +]
667 +
668 +[[package]]
669 +name = "openssl-macros"
670 +version = "0.1.1"
671 +source = "registry+https://github.com/rust-lang/crates.io-index"
672 +checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c"
673 +dependencies = [
674 + "proc-macro2",
675 + "quote",
676 + "syn 2.0.119",
677 +]
678 +
689 679 [[package]]
690 680 name = "openssl-probe"
691 681 version = "0.2.1"
692 682 source = "registry+https://github.com/rust-lang/crates.io-index"
693 683 checksum = "7c87def4c32ab89d880effc9e097653c8da5d6ef28e6b539d313baaacfbafcbe"
694 684
685 +[[package]]
686 +name = "openssl-sys"
687 +version = "0.9.117"
688 +source = "registry+https://github.com/rust-lang/crates.io-index"
689 +checksum = "b47e7e6bb2c38cd930d25a23b40fa52e068c10e85f3e03a7f5ba5aaca5713695"
690 +dependencies = [
691 + "cc",
692 + "libc",
693 + "pkg-config",
694 + "vcpkg",
695 +]
696 +
695 697 [[package]]
696 698 name = "option-ext"
697 699 version = "0.2.0"
@@ -786,20 +788,6 @@ version = "0.8.11"
786 788 source = "registry+https://github.com/rust-lang/crates.io-index"
787 789 checksum = "d6f6ff9a378485b298a5286656da665ba74413d36db0979633275d2e708145d4"
788 790
789 −[[package]]
790 −name = "ring"
791 −version = "0.17.14"
792 −source = "registry+https://github.com/rust-lang/crates.io-index"
793 −checksum = "a4689e6c2294d81e88dc6261c768b63bc4fcdb852be6d1352498b114f61383b7"
794 −dependencies = [
795 − "cc",
796 − "cfg-if",
797 − "getrandom 0.2.17",
798 − "libc",
799 − "untrusted",
800 − "windows-sys 0.52.0",
801 −]
802 −
803 791 [[package]]
804 792 name = "rumqttc"
805 793 version = "0.25.1"
@@ -811,12 +799,10 @@ dependencies = [
811 799 "flume",
812 800 "futures-util",
813 801 "log",
814 − "rustls-native-certs",
815 − "rustls-pemfile",
816 − "rustls-webpki 0.102.8",
802 + "native-tls",
817 803 "thiserror",
818 804 "tokio",
819 − "tokio-rustls",
805 + "tokio-native-tls",
820 806 "tokio-stream",
821 807 "tokio-util",
822 808 ]
@@ -831,75 +817,7 @@ dependencies = [
831 817 "errno",
832 818 "libc",
833 819 "linux-raw-sys",
834 − "windows-sys 0.61.2",
835 −]
836 −
837 −[[package]]
838 −name = "rustls"
839 −version = "0.23.46"
840 −source = "registry+https://github.com/rust-lang/crates.io-index"
841 −checksum = "48e13bd8c0e9365c43cfa5c9e8f9ad49d3c8444926c9aac819e0e4dc503c8fdf"
842 −dependencies = [
843 − "aws-lc-rs",
844 − "log",
845 − "once_cell",
846 − "rustls-pki-types",
847 − "rustls-webpki 0.103.16",
848 − "subtle",
849 − "zeroize",
850 −]
851 −
852 −[[package]]
853 −name = "rustls-native-certs"
854 −version = "0.8.4"
855 −source = "registry+https://github.com/rust-lang/crates.io-index"
856 −checksum = "dab5152771c58876a2146916e53e35057e1a4dfa2b9df0f0305b07f611fdea4d"
857 −dependencies = [
858 − "openssl-probe",
859 − "rustls-pki-types",
860 − "schannel",
861 − "security-framework",
862 −]
863 −
864 −[[package]]
865 −name = "rustls-pemfile"
866 −version = "2.2.0"
867 −source = "registry+https://github.com/rust-lang/crates.io-index"
868 −checksum = "dce314e5fee3f39953d46bb63bb8a46d40c2f8fb7cc5a3b6cab2bde9721d6e50"
869 −dependencies = [
870 − "rustls-pki-types",
871 −]
872 −
873 −[[package]]
874 −name = "rustls-pki-types"
875 −version = "1.15.1"
876 −source = "registry+https://github.com/rust-lang/crates.io-index"
877 −checksum = "2f4925028c7eb5d1fcdaf196971378ed9d2c1c4efc7dc5d011256f76c99c0a96"
878 −dependencies = [
879 − "zeroize",
880 −]
881 −
882 −[[package]]
883 −name = "rustls-webpki"
884 −version = "0.102.8"
885 −source = "registry+https://github.com/rust-lang/crates.io-index"
886 −checksum = "64ca1bc8749bd4cf37b5ce386cc146580777b4e8572c7b97baf22c83f444bee9"
887 −dependencies = [
888 − "ring",
889 − "rustls-pki-types",
890 − "untrusted",
891 −]
892 −
893 −[[package]]
894 −name = "rustls-webpki"
895 −version = "0.103.16"
896 −source = "registry+https://github.com/rust-lang/crates.io-index"
897 −checksum = "4443b1b6d39d7c663139942cc4558262562d2c84123bb6282ef177009ca8b281"
898 −dependencies = [
899 − "aws-lc-rs",
900 − "ring",
901 − "rustls-pki-types",
902 − "untrusted",
820 + "windows-sys",
903 821 ]
904 822
905 823 [[package]]
@@ -914,7 +832,7 @@ version = "0.1.29"
914 832 source = "registry+https://github.com/rust-lang/crates.io-index"
915 833 checksum = "91c1b7e4904c873ef0710c1f407dde2e6287de2bebc1bbbf7d430bb7cbffd939"
916 834 dependencies = [
917 − "windows-sys 0.61.2",
835 + "windows-sys",
918 836 ]
919 837
920 838 [[package]]
@@ -1053,7 +971,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
1053 971 checksum = "c3d1e2c7f27f8d4cb10542a02c49005dbd6e93095799d6f3be745fae9f8fedd4"
1054 972 dependencies = [
1055 973 "libc",
1056 − "windows-sys 0.61.2",
974 + "windows-sys",
1057 975 ]
1058 976
1059 977 [[package]]
@@ -1077,12 +995,6 @@ version = "0.11.1"
1077 995 source = "registry+https://github.com/rust-lang/crates.io-index"
1078 996 checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f"
1079 997
1080 −[[package]]
1081 −name = "subtle"
1082 −version = "2.6.1"
1083 −source = "registry+https://github.com/rust-lang/crates.io-index"
1084 −checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292"
1085 −
1086 998 [[package]]
1087 999 name = "syn"
1088 1000 version = "2.0.119"
@@ -1123,10 +1035,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
1123 1035 checksum = "32497e9a4c7b38532efcdebeef879707aa9f794296a4f0244f6f69e9bc8574bd"
1124 1036 dependencies = [
1125 1037 "fastrand",
1126 − "getrandom 0.4.3",
1038 + "getrandom",
1127 1039 "once_cell",
1128 1040 "rustix",
1129 − "windows-sys 0.61.2",
1041 + "windows-sys",
1130 1042 ]
1131 1043
1132 1044 [[package]]
@@ -1181,7 +1093,7 @@ dependencies = [
1181 1093 "signal-hook-registry",
1182 1094 "socket2",
1183 1095 "tokio-macros",
1184 − "windows-sys 0.61.2",
1096 + "windows-sys",
1185 1097 ]
1186 1098
1187 1099 [[package]]
@@ -1196,12 +1108,12 @@ dependencies = [
1196 1108 ]
1197 1109
1198 1110 [[package]]
1199 −name = "tokio-rustls"
1200 −version = "0.26.6"
1111 +name = "tokio-native-tls"
1112 +version = "0.3.1"
1201 1113 source = "registry+https://github.com/rust-lang/crates.io-index"
1202 −checksum = "c9cc2678c2cdd569ef8215e2afd7954ada2ae20b4fdd2c5fe6139a3b02d105db"
1114 +checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2"
1203 1115 dependencies = [
1204 − "rustls",
1116 + "native-tls",
1205 1117 "tokio",
1206 1118 ]
1207 1119
@@ -1338,7 +1250,7 @@ checksum = "f2f6fb2847f6742cd76af783a2a2c49e9375d0a111c7bef6f71cd9e738c72d6e"
1338 1250 dependencies = [
1339 1251 "memoffset",
1340 1252 "tempfile",
1341 − "windows-sys 0.61.2",
1253 + "windows-sys",
1342 1254 ]
1343 1255
1344 1256 [[package]]
@@ -1347,12 +1259,6 @@ version = "1.0.26"
1347 1259 source = "registry+https://github.com/rust-lang/crates.io-index"
1348 1260 checksum = "d245f478577f809a851594d02313b640fb437e0bb33866753cff937863096954"
1349 1261
1350 −[[package]]
1351 −name = "untrusted"
1352 −version = "0.9.0"
1353 −source = "registry+https://github.com/rust-lang/crates.io-index"
1354 −checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1"
1355 −
1356 1262 [[package]]
1357 1263 name = "url"
1358 1264 version = "2.5.8"
@@ -1394,6 +1300,12 @@ version = "0.1.1"
1394 1300 source = "registry+https://github.com/rust-lang/crates.io-index"
1395 1301 checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65"
1396 1302
1303 +[[package]]
1304 +name = "vcpkg"
1305 +version = "0.2.15"
1306 +source = "registry+https://github.com/rust-lang/crates.io-index"
1307 +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426"
1308 +
1397 1309 [[package]]
1398 1310 name = "wasi"
1399 1311 version = "0.11.1+wasi-snapshot-preview1"
@@ -1451,15 +1363,6 @@ version = "0.2.1"
1451 1363 source = "registry+https://github.com/rust-lang/crates.io-index"
1452 1364 checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5"
1453 1365
1454 −[[package]]
1455 −name = "windows-sys"
1456 −version = "0.52.0"
1457 −source = "registry+https://github.com/rust-lang/crates.io-index"
1458 −checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d"
1459 −dependencies = [
1460 − "windows-targets",
1461 −]
1462 −
1463 1366 [[package]]
1464 1367 name = "windows-sys"
1465 1368 version = "0.61.2"
@@ -1469,70 +1372,6 @@ dependencies = [
1469 1372 "windows-link",
1470 1373 ]
1471 1374
1472 −[[package]]
1473 −name = "windows-targets"
1474 −version = "0.52.6"
1475 −source = "registry+https://github.com/rust-lang/crates.io-index"
1476 −checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973"
1477 −dependencies = [
1478 − "windows_aarch64_gnullvm",
1479 − "windows_aarch64_msvc",
1480 − "windows_i686_gnu",
1481 − "windows_i686_gnullvm",
1482 − "windows_i686_msvc",
1483 − "windows_x86_64_gnu",
1484 − "windows_x86_64_gnullvm",
1485 − "windows_x86_64_msvc",
1486 −]
1487 −
1488 −[[package]]
1489 −name = "windows_aarch64_gnullvm"
1490 −version = "0.52.6"
1491 −source = "registry+https://github.com/rust-lang/crates.io-index"
1492 −checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3"
1493 −
1494 −[[package]]
1495 −name = "windows_aarch64_msvc"
1496 −version = "0.52.6"
1497 −source = "registry+https://github.com/rust-lang/crates.io-index"
1498 −checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469"
1499 −
1500 −[[package]]
1501 −name = "windows_i686_gnu"
1502 −version = "0.52.6"
1503 −source = "registry+https://github.com/rust-lang/crates.io-index"
1504 −checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b"
1505 −
1506 −[[package]]
1507 −name = "windows_i686_gnullvm"
1508 −version = "0.52.6"
1509 −source = "registry+https://github.com/rust-lang/crates.io-index"
1510 −checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66"
1511 −
1512 −[[package]]
1513 −name = "windows_i686_msvc"
1514 −version = "0.52.6"
1515 −source = "registry+https://github.com/rust-lang/crates.io-index"
1516 −checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66"
1517 −
1518 −[[package]]
1519 −name = "windows_x86_64_gnu"
1520 −version = "0.52.6"
1521 −source = "registry+https://github.com/rust-lang/crates.io-index"
1522 −checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78"
1523 −
1524 −[[package]]
1525 −name = "windows_x86_64_gnullvm"
1526 −version = "0.52.6"
1527 −source = "registry+https://github.com/rust-lang/crates.io-index"
1528 −checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d"
1529 −
1530 −[[package]]
1531 −name = "windows_x86_64_msvc"
1532 −version = "0.52.6"
1533 −source = "registry+https://github.com/rust-lang/crates.io-index"
1534 −checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec"
1535 −
1536 1375 [[package]]
1537 1376 name = "winnow"
1538 1377 version = "0.7.15"
@@ -1597,7 +1436,7 @@ dependencies = [
1597 1436 "tokio",
1598 1437 "uds_windows",
1599 1438 "uuid",
1600 − "windows-sys 0.61.2",
1439 + "windows-sys",
1601 1440 "winnow 1.0.4",
1602 1441 "zbus_macros",
1603 1442 "zbus_utils",
@@ -1660,12 +1499,6 @@ dependencies = [
1660 1499 "synstructure",
1661 1500 ]
1662 1501
1663 −[[package]]
1664 −name = "zeroize"
1665 −version = "1.9.0"
1666 −source = "registry+https://github.com/rust-lang/crates.io-index"
1667 −checksum = "e13c156562582aa81c60cb29407084cdb54c4164760106ab78e6c5b0858cf64e"
1668 −
1669 1502 [[package]]
1670 1503 name = "zerotrie"
1671 1504 version = "0.2.5"
modified Cargo.toml
+3 −1
@@ -12,7 +12,9 @@ apollos-types = "0.3"
12 12 clap = { version = "4.5", features = ["derive", "env"] }
13 13 dirs = "6"
14 14 gethostname = "1"
15 −rumqttc = "0.25"
15 +# Native TLS, not rustls: rumqttc 0.25's rustls path pins rustls-webpki 0.102
16 +# and rustls-pemfile 2, both with open advisories (bytebeamio/rumqtt#1067).
17 +rumqttc = { version = "0.25", default-features = false, features = ["use-native-tls"] }
16 18 serde = { version = "1", features = ["derive"] }
17 19 serde_json = "1"
18 20 tokio = { version = "1", features = ["macros", "rt-multi-thread", "sync", "time", "signal", "fs"] }
modified README.md
+9 −0
@@ -18,6 +18,10 @@ truth for the shapes on the wire.
18 18
19 19 ## Install
20 20
21 +TLS goes through the system OpenSSL, so building needs its headers and
22 +`pkg-config` (`libssl-dev` on Debian/Ubuntu, `openssl-devel` on Fedora,
23 +`libopenssl-3-devel` on openSUSE).
24 +
21 25 ```sh
22 26 cargo build --release
23 27 install -Dm755 target/release/apollos-dbus ~/.local/bin/apollos-dbus
@@ -60,6 +64,11 @@ The **client id** defaults to `apollos-dbus-<hostname>`, and a second
60 64 connection appends its source's name. An Ankyra with auto-registration off
61 65 refuses an id it has not been given -- add it on the Ankyra's page.
62 66
67 +With `tls = true` the broker's certificate is checked against the system's
68 +roots and its host name. A broker signed by a private CA wants that CA in
69 +the system store, or `SSL_CERT_FILE=/path/to/ca.pem` in the unit's
70 +environment.
71 +
63 72 ## The interface
64 73
65 74 Bus name `io.neiam.ApollosCrib`. Everything is a property, every change a
modified src/source.rs
+6 −2
@@ -7,7 +7,9 @@
7 7
8 8 use std::time::Duration;
9 9
10 −use rumqttc::{AsyncClient, Event as MqttEvent, MqttOptions, Packet, QoS, Transport};
10 +use rumqttc::{
11 + AsyncClient, Event as MqttEvent, MqttOptions, Packet, QoS, TlsConfiguration, Transport,
12 +};
11 13 use serde_json::{Value, json};
12 14 use tokio::sync::mpsc;
13 15 use tracing::{debug, info, warn};
@@ -60,7 +62,9 @@ pub async fn run(
60 62 opts.set_credentials(&b.username, &b.password);
61 63 }
62 64 if b.tls {
63 − opts.set_transport(Transport::tls_with_default_config());
65 + // The platform's TLS (OpenSSL on Linux): the system roots, plus
66 + // whatever SSL_CERT_FILE / SSL_CERT_DIR name, and the host name checked.
67 + opts.set_transport(Transport::tls_with_config(TlsConfiguration::Native));
64 68 }
65 69
66 70 let (client, mut eventloop) = AsyncClient::new(opts, 32);

Parents: 0eedfc0