├── .github └── workflows │ ├── rust-build.yml │ └── rust.yml ├── .gitignore ├── Cargo.lock ├── Cargo.toml ├── LICENSE ├── README.md ├── Restls-Script: Hide Your Proxy Traffic Behavior.md ├── Restls-Script: 隐藏你的代理行为.md ├── Restls: A Perfect Impersonation of TLS.md ├── Restls: 对TLS的完美伪装.md ├── assets ├── padding.png ├── restls-script.png └── tls-in-tls-illustration.png └── src ├── args.rs ├── client_hello.rs ├── client_key_exchange.rs ├── common.rs ├── main.rs ├── restls.rs ├── server_hello.rs └── utils.rs /.github/workflows/rust-build.yml: -------------------------------------------------------------------------------- 1 | name: Rust-Build 2 | 3 | on: 4 | push: 5 | tags: 6 | - v* 7 | 8 | env: 9 | CARGO_TERM_COLOR: always 10 | CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse 11 | 12 | jobs: 13 | build-cross: 14 | runs-on: ubuntu-latest 15 | env: 16 | RUST_BACKTRACE: full 17 | strategy: 18 | matrix: 19 | target: 20 | - x86_64-unknown-linux-musl 21 | - aarch64-unknown-linux-musl 22 | - armv7-unknown-linux-musleabihf 23 | - arm-unknown-linux-musleabi 24 | steps: 25 | - uses: actions/checkout@v2 26 | - name: Install Rust 27 | uses: actions-rs/toolchain@v1 28 | with: 29 | profile: minimal 30 | target: ${{ matrix.target }} 31 | toolchain: nightly 32 | default: true 33 | override: true 34 | - name: Install cross 35 | run: cargo install cross 36 | - name: Build ${{ matrix.target }} 37 | timeout-minutes: 120 38 | run: | 39 | cross build --release --target ${{ matrix.target }} && 40 | mv target/${{ matrix.target }}/release/restls target/${{ matrix.target }}/release/restls-${{ matrix.target }} 41 | - name: Upload Github Assets 42 | uses: softprops/action-gh-release@v1 43 | env: 44 | GITHUB_TOKEN: ${{ secrets.gh_upload }} 45 | with: 46 | files: target/${{ matrix.target }}/release/restls-${{ matrix.target }} 47 | prerelease: ${{ contains(github.ref, '-') }} 48 | -------------------------------------------------------------------------------- /.github/workflows/rust.yml: -------------------------------------------------------------------------------- 1 | name: Rust 2 | 3 | on: 4 | push: 5 | branches: [ "main" ] 6 | pull_request: 7 | branches: [ "main" ] 8 | 9 | env: 10 | CARGO_TERM_COLOR: always 11 | 12 | jobs: 13 | test: 14 | strategy: 15 | matrix: 16 | target: 17 | - aarch64-unknown-linux-gnu 18 | - x86_64-unknown-linux-gnu 19 | - arm-unknown-linux-gnueabi 20 | - armv7-unknown-linux-gnueabihf 21 | runs-on: ubuntu-latest 22 | steps: 23 | - uses: actions/checkout@v3 24 | - name: Install Rust 25 | run: rustup update stable 26 | - name: Install cross-compilation tools 27 | uses: taiki-e/setup-cross-toolchain-action@v1 28 | with: 29 | target: ${{ matrix.target }} 30 | - run: cargo test --verbose 31 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | .DS_Store -------------------------------------------------------------------------------- /Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | version = 3 4 | 5 | [[package]] 6 | name = "addr2line" 7 | version = "0.20.0" 8 | source = "registry+https://github.com/rust-lang/crates.io-index" 9 | checksum = "f4fa78e18c64fce05e902adecd7a5eed15a5e0a3439f7b0e169f0252214865e3" 10 | dependencies = [ 11 | "gimli", 12 | ] 13 | 14 | [[package]] 15 | name = "adler" 16 | version = "1.0.2" 17 | source = "registry+https://github.com/rust-lang/crates.io-index" 18 | checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" 19 | 20 | [[package]] 21 | name = "ahash" 22 | version = "0.7.6" 23 | source = "registry+https://github.com/rust-lang/crates.io-index" 24 | checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" 25 | dependencies = [ 26 | "getrandom", 27 | "once_cell", 28 | "version_check", 29 | ] 30 | 31 | [[package]] 32 | name = "ansi_term" 33 | version = "0.12.1" 34 | source = "registry+https://github.com/rust-lang/crates.io-index" 35 | checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2" 36 | dependencies = [ 37 | "winapi", 38 | ] 39 | 40 | [[package]] 41 | name = "anyhow" 42 | version = "1.0.72" 43 | source = "registry+https://github.com/rust-lang/crates.io-index" 44 | checksum = "3b13c32d80ecc7ab747b80c3784bce54ee8a7a0cc4fbda9bf4cda2cf6fe90854" 45 | 46 | [[package]] 47 | name = "arrayref" 48 | version = "0.3.6" 49 | source = "registry+https://github.com/rust-lang/crates.io-index" 50 | checksum = "a4c527152e37cf757a3f78aae5a06fbeefdb07ccc535c980a3208ee3060dd544" 51 | 52 | [[package]] 53 | name = "arrayvec" 54 | version = "0.7.2" 55 | source = "registry+https://github.com/rust-lang/crates.io-index" 56 | checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6" 57 | 58 | [[package]] 59 | name = "atty" 60 | version = "0.2.14" 61 | source = "registry+https://github.com/rust-lang/crates.io-index" 62 | checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" 63 | dependencies = [ 64 | "hermit-abi 0.1.19", 65 | "libc", 66 | "winapi", 67 | ] 68 | 69 | [[package]] 70 | name = "autocfg" 71 | version = "1.1.0" 72 | source = "registry+https://github.com/rust-lang/crates.io-index" 73 | checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" 74 | 75 | [[package]] 76 | name = "backtrace" 77 | version = "0.3.68" 78 | source = "registry+https://github.com/rust-lang/crates.io-index" 79 | checksum = "4319208da049c43661739c5fade2ba182f09d1dc2299b32298d3a31692b17e12" 80 | dependencies = [ 81 | "addr2line", 82 | "cc", 83 | "cfg-if", 84 | "libc", 85 | "miniz_oxide", 86 | "object", 87 | "rustc-demangle", 88 | ] 89 | 90 | [[package]] 91 | name = "bitflags" 92 | version = "1.3.2" 93 | source = "registry+https://github.com/rust-lang/crates.io-index" 94 | checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" 95 | 96 | [[package]] 97 | name = "blake3" 98 | version = "1.4.1" 99 | source = "registry+https://github.com/rust-lang/crates.io-index" 100 | checksum = "199c42ab6972d92c9f8995f086273d25c42fc0f7b2a1fcefba465c1352d25ba5" 101 | dependencies = [ 102 | "arrayref", 103 | "arrayvec", 104 | "cc", 105 | "cfg-if", 106 | "constant_time_eq", 107 | "digest", 108 | ] 109 | 110 | [[package]] 111 | name = "block-buffer" 112 | version = "0.10.3" 113 | source = "registry+https://github.com/rust-lang/crates.io-index" 114 | checksum = "69cce20737498f97b993470a6e536b8523f0af7892a4f928cceb1ac5e52ebe7e" 115 | dependencies = [ 116 | "generic-array", 117 | ] 118 | 119 | [[package]] 120 | name = "bytes" 121 | version = "1.3.0" 122 | source = "registry+https://github.com/rust-lang/crates.io-index" 123 | checksum = "dfb24e866b15a1af2a1b663f10c6b6b8f397a84aadb828f12e5b289ec23a3a3c" 124 | 125 | [[package]] 126 | name = "cc" 127 | version = "1.0.78" 128 | source = "registry+https://github.com/rust-lang/crates.io-index" 129 | checksum = "a20104e2335ce8a659d6dd92a51a767a0c062599c73b343fd152cb401e828c3d" 130 | 131 | [[package]] 132 | name = "cfg-if" 133 | version = "1.0.0" 134 | source = "registry+https://github.com/rust-lang/crates.io-index" 135 | checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" 136 | 137 | [[package]] 138 | name = "clap" 139 | version = "2.34.0" 140 | source = "registry+https://github.com/rust-lang/crates.io-index" 141 | checksum = "a0610544180c38b88101fecf2dd634b174a62eef6946f84dfc6a7127512b381c" 142 | dependencies = [ 143 | "ansi_term", 144 | "atty", 145 | "bitflags", 146 | "strsim 0.8.0", 147 | "textwrap", 148 | "unicode-width", 149 | "vec_map", 150 | ] 151 | 152 | [[package]] 153 | name = "clap" 154 | version = "4.1.1" 155 | source = "registry+https://github.com/rust-lang/crates.io-index" 156 | checksum = "4ec7a4128863c188deefe750ac1d1dfe66c236909f845af04beed823638dc1b2" 157 | dependencies = [ 158 | "bitflags", 159 | "clap_lex", 160 | "is-terminal", 161 | "strsim 0.10.0", 162 | "termcolor", 163 | ] 164 | 165 | [[package]] 166 | name = "clap_lex" 167 | version = "0.3.1" 168 | source = "registry+https://github.com/rust-lang/crates.io-index" 169 | checksum = "783fe232adfca04f90f56201b26d79682d4cd2625e0bc7290b95123afe558ade" 170 | dependencies = [ 171 | "os_str_bytes", 172 | ] 173 | 174 | [[package]] 175 | name = "constant_time_eq" 176 | version = "0.3.0" 177 | source = "registry+https://github.com/rust-lang/crates.io-index" 178 | checksum = "f7144d30dcf0fafbce74250a3963025d8d52177934239851c917d29f1df280c2" 179 | 180 | [[package]] 181 | name = "cpufeatures" 182 | version = "0.2.5" 183 | source = "registry+https://github.com/rust-lang/crates.io-index" 184 | checksum = "28d997bd5e24a5928dd43e46dc529867e207907fe0b239c3477d924f7f2ca320" 185 | dependencies = [ 186 | "libc", 187 | ] 188 | 189 | [[package]] 190 | name = "crypto-common" 191 | version = "0.1.6" 192 | source = "registry+https://github.com/rust-lang/crates.io-index" 193 | checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" 194 | dependencies = [ 195 | "generic-array", 196 | "typenum", 197 | ] 198 | 199 | [[package]] 200 | name = "digest" 201 | version = "0.10.6" 202 | source = "registry+https://github.com/rust-lang/crates.io-index" 203 | checksum = "8168378f4e5023e7218c89c891c0fd8ecdb5e5e4f18cb78f38cf245dd021e76f" 204 | dependencies = [ 205 | "block-buffer", 206 | "crypto-common", 207 | "subtle", 208 | ] 209 | 210 | [[package]] 211 | name = "errno" 212 | version = "0.2.8" 213 | source = "registry+https://github.com/rust-lang/crates.io-index" 214 | checksum = "f639046355ee4f37944e44f60642c6f3a7efa3cf6b78c78a0d989a8ce6c396a1" 215 | dependencies = [ 216 | "errno-dragonfly", 217 | "libc", 218 | "winapi", 219 | ] 220 | 221 | [[package]] 222 | name = "errno-dragonfly" 223 | version = "0.1.2" 224 | source = "registry+https://github.com/rust-lang/crates.io-index" 225 | checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" 226 | dependencies = [ 227 | "cc", 228 | "libc", 229 | ] 230 | 231 | [[package]] 232 | name = "futures-core" 233 | version = "0.3.26" 234 | source = "registry+https://github.com/rust-lang/crates.io-index" 235 | checksum = "ec90ff4d0fe1f57d600049061dc6bb68ed03c7d2fbd697274c41805dcb3f8608" 236 | 237 | [[package]] 238 | name = "futures-io" 239 | version = "0.3.26" 240 | source = "registry+https://github.com/rust-lang/crates.io-index" 241 | checksum = "bfb8371b6fb2aeb2d280374607aeabfc99d95c72edfe51692e42d3d7f0d08531" 242 | 243 | [[package]] 244 | name = "futures-macro" 245 | version = "0.3.26" 246 | source = "registry+https://github.com/rust-lang/crates.io-index" 247 | checksum = "95a73af87da33b5acf53acfebdc339fe592ecf5357ac7c0a7734ab9d8c876a70" 248 | dependencies = [ 249 | "proc-macro2", 250 | "quote", 251 | "syn 1.0.107", 252 | ] 253 | 254 | [[package]] 255 | name = "futures-sink" 256 | version = "0.3.26" 257 | source = "registry+https://github.com/rust-lang/crates.io-index" 258 | checksum = "f310820bb3e8cfd46c80db4d7fb8353e15dfff853a127158425f31e0be6c8364" 259 | 260 | [[package]] 261 | name = "futures-task" 262 | version = "0.3.26" 263 | source = "registry+https://github.com/rust-lang/crates.io-index" 264 | checksum = "dcf79a1bf610b10f42aea489289c5a2c478a786509693b80cd39c44ccd936366" 265 | 266 | [[package]] 267 | name = "futures-util" 268 | version = "0.3.26" 269 | source = "registry+https://github.com/rust-lang/crates.io-index" 270 | checksum = "9c1d6de3acfef38d2be4b1f543f553131788603495be83da675e180c8d6b7bd1" 271 | dependencies = [ 272 | "futures-core", 273 | "futures-macro", 274 | "futures-task", 275 | "pin-project-lite", 276 | "pin-utils", 277 | "slab", 278 | ] 279 | 280 | [[package]] 281 | name = "generic-array" 282 | version = "0.14.6" 283 | source = "registry+https://github.com/rust-lang/crates.io-index" 284 | checksum = "bff49e947297f3312447abdca79f45f4738097cc82b06e72054d2223f601f1b9" 285 | dependencies = [ 286 | "typenum", 287 | "version_check", 288 | ] 289 | 290 | [[package]] 291 | name = "getrandom" 292 | version = "0.2.8" 293 | source = "registry+https://github.com/rust-lang/crates.io-index" 294 | checksum = "c05aeb6a22b8f62540c194aac980f2115af067bfe15a0734d7277a768d396b31" 295 | dependencies = [ 296 | "cfg-if", 297 | "libc", 298 | "wasi", 299 | ] 300 | 301 | [[package]] 302 | name = "gimli" 303 | version = "0.27.3" 304 | source = "registry+https://github.com/rust-lang/crates.io-index" 305 | checksum = "b6c80984affa11d98d1b88b66ac8853f143217b399d3c74116778ff8fdb4ed2e" 306 | 307 | [[package]] 308 | name = "hashbrown" 309 | version = "0.12.3" 310 | source = "registry+https://github.com/rust-lang/crates.io-index" 311 | checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" 312 | dependencies = [ 313 | "ahash", 314 | ] 315 | 316 | [[package]] 317 | name = "heck" 318 | version = "0.3.3" 319 | source = "registry+https://github.com/rust-lang/crates.io-index" 320 | checksum = "6d621efb26863f0e9924c6ac577e8275e5e6b77455db64ffa6c65c904e9e132c" 321 | dependencies = [ 322 | "unicode-segmentation", 323 | ] 324 | 325 | [[package]] 326 | name = "hermit-abi" 327 | version = "0.1.19" 328 | source = "registry+https://github.com/rust-lang/crates.io-index" 329 | checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" 330 | dependencies = [ 331 | "libc", 332 | ] 333 | 334 | [[package]] 335 | name = "hermit-abi" 336 | version = "0.2.6" 337 | source = "registry+https://github.com/rust-lang/crates.io-index" 338 | checksum = "ee512640fe35acbfb4bb779db6f0d80704c2cacfa2e39b601ef3e3f47d1ae4c7" 339 | dependencies = [ 340 | "libc", 341 | ] 342 | 343 | [[package]] 344 | name = "hmac" 345 | version = "0.12.1" 346 | source = "registry+https://github.com/rust-lang/crates.io-index" 347 | checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" 348 | dependencies = [ 349 | "digest", 350 | ] 351 | 352 | [[package]] 353 | name = "io-lifetimes" 354 | version = "1.0.4" 355 | source = "registry+https://github.com/rust-lang/crates.io-index" 356 | checksum = "e7d6c6f8c91b4b9ed43484ad1a938e393caf35960fce7f82a040497207bd8e9e" 357 | dependencies = [ 358 | "libc", 359 | "windows-sys 0.42.0", 360 | ] 361 | 362 | [[package]] 363 | name = "is-terminal" 364 | version = "0.4.2" 365 | source = "registry+https://github.com/rust-lang/crates.io-index" 366 | checksum = "28dfb6c8100ccc63462345b67d1bbc3679177c75ee4bf59bf29c8b1d110b8189" 367 | dependencies = [ 368 | "hermit-abi 0.2.6", 369 | "io-lifetimes", 370 | "rustix", 371 | "windows-sys 0.42.0", 372 | ] 373 | 374 | [[package]] 375 | name = "lazy_static" 376 | version = "1.4.0" 377 | source = "registry+https://github.com/rust-lang/crates.io-index" 378 | checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" 379 | 380 | [[package]] 381 | name = "libc" 382 | version = "0.2.147" 383 | source = "registry+https://github.com/rust-lang/crates.io-index" 384 | checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" 385 | 386 | [[package]] 387 | name = "linux-raw-sys" 388 | version = "0.1.4" 389 | source = "registry+https://github.com/rust-lang/crates.io-index" 390 | checksum = "f051f77a7c8e6957c0696eac88f26b0117e54f52d3fc682ab19397a8812846a4" 391 | 392 | [[package]] 393 | name = "lock_api" 394 | version = "0.4.9" 395 | source = "registry+https://github.com/rust-lang/crates.io-index" 396 | checksum = "435011366fe56583b16cf956f9df0095b405b82d76425bc8981c0e22e60ec4df" 397 | dependencies = [ 398 | "autocfg", 399 | "scopeguard", 400 | ] 401 | 402 | [[package]] 403 | name = "log" 404 | version = "0.4.17" 405 | source = "registry+https://github.com/rust-lang/crates.io-index" 406 | checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" 407 | dependencies = [ 408 | "cfg-if", 409 | ] 410 | 411 | [[package]] 412 | name = "memchr" 413 | version = "2.5.0" 414 | source = "registry+https://github.com/rust-lang/crates.io-index" 415 | checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" 416 | 417 | [[package]] 418 | name = "miniz_oxide" 419 | version = "0.7.1" 420 | source = "registry+https://github.com/rust-lang/crates.io-index" 421 | checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" 422 | dependencies = [ 423 | "adler", 424 | ] 425 | 426 | [[package]] 427 | name = "mio" 428 | version = "0.8.8" 429 | source = "registry+https://github.com/rust-lang/crates.io-index" 430 | checksum = "927a765cd3fc26206e66b296465fa9d3e5ab003e651c1b3c060e7956d96b19d2" 431 | dependencies = [ 432 | "libc", 433 | "wasi", 434 | "windows-sys 0.48.0", 435 | ] 436 | 437 | [[package]] 438 | name = "nu-ansi-term" 439 | version = "0.46.0" 440 | source = "registry+https://github.com/rust-lang/crates.io-index" 441 | checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" 442 | dependencies = [ 443 | "overload", 444 | "winapi", 445 | ] 446 | 447 | [[package]] 448 | name = "num_cpus" 449 | version = "1.15.0" 450 | source = "registry+https://github.com/rust-lang/crates.io-index" 451 | checksum = "0fac9e2da13b5eb447a6ce3d392f23a29d8694bff781bf03a16cd9ac8697593b" 452 | dependencies = [ 453 | "hermit-abi 0.2.6", 454 | "libc", 455 | ] 456 | 457 | [[package]] 458 | name = "object" 459 | version = "0.31.1" 460 | source = "registry+https://github.com/rust-lang/crates.io-index" 461 | checksum = "8bda667d9f2b5051b8833f59f3bf748b28ef54f850f4fcb389a252aa383866d1" 462 | dependencies = [ 463 | "memchr", 464 | ] 465 | 466 | [[package]] 467 | name = "once_cell" 468 | version = "1.17.0" 469 | source = "registry+https://github.com/rust-lang/crates.io-index" 470 | checksum = "6f61fba1741ea2b3d6a1e3178721804bb716a68a6aeba1149b5d52e3d464ea66" 471 | 472 | [[package]] 473 | name = "os_str_bytes" 474 | version = "6.4.1" 475 | source = "registry+https://github.com/rust-lang/crates.io-index" 476 | checksum = "9b7820b9daea5457c9f21c69448905d723fbd21136ccf521748f23fd49e723ee" 477 | 478 | [[package]] 479 | name = "overload" 480 | version = "0.1.1" 481 | source = "registry+https://github.com/rust-lang/crates.io-index" 482 | checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" 483 | 484 | [[package]] 485 | name = "parking_lot" 486 | version = "0.12.1" 487 | source = "registry+https://github.com/rust-lang/crates.io-index" 488 | checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" 489 | dependencies = [ 490 | "lock_api", 491 | "parking_lot_core", 492 | ] 493 | 494 | [[package]] 495 | name = "parking_lot_core" 496 | version = "0.9.6" 497 | source = "registry+https://github.com/rust-lang/crates.io-index" 498 | checksum = "ba1ef8814b5c993410bb3adfad7a5ed269563e4a2f90c41f5d85be7fb47133bf" 499 | dependencies = [ 500 | "cfg-if", 501 | "libc", 502 | "redox_syscall", 503 | "smallvec", 504 | "windows-sys 0.42.0", 505 | ] 506 | 507 | [[package]] 508 | name = "pin-project-lite" 509 | version = "0.2.9" 510 | source = "registry+https://github.com/rust-lang/crates.io-index" 511 | checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" 512 | 513 | [[package]] 514 | name = "pin-utils" 515 | version = "0.1.0" 516 | source = "registry+https://github.com/rust-lang/crates.io-index" 517 | checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" 518 | 519 | [[package]] 520 | name = "ppv-lite86" 521 | version = "0.2.17" 522 | source = "registry+https://github.com/rust-lang/crates.io-index" 523 | checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" 524 | 525 | [[package]] 526 | name = "proc-macro-error" 527 | version = "1.0.4" 528 | source = "registry+https://github.com/rust-lang/crates.io-index" 529 | checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" 530 | dependencies = [ 531 | "proc-macro-error-attr", 532 | "proc-macro2", 533 | "quote", 534 | "syn 1.0.107", 535 | "version_check", 536 | ] 537 | 538 | [[package]] 539 | name = "proc-macro-error-attr" 540 | version = "1.0.4" 541 | source = "registry+https://github.com/rust-lang/crates.io-index" 542 | checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" 543 | dependencies = [ 544 | "proc-macro2", 545 | "quote", 546 | "version_check", 547 | ] 548 | 549 | [[package]] 550 | name = "proc-macro2" 551 | version = "1.0.66" 552 | source = "registry+https://github.com/rust-lang/crates.io-index" 553 | checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" 554 | dependencies = [ 555 | "unicode-ident", 556 | ] 557 | 558 | [[package]] 559 | name = "quote" 560 | version = "1.0.32" 561 | source = "registry+https://github.com/rust-lang/crates.io-index" 562 | checksum = "50f3b39ccfb720540debaa0164757101c08ecb8d326b15358ce76a62c7e85965" 563 | dependencies = [ 564 | "proc-macro2", 565 | ] 566 | 567 | [[package]] 568 | name = "rand" 569 | version = "0.8.5" 570 | source = "registry+https://github.com/rust-lang/crates.io-index" 571 | checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" 572 | dependencies = [ 573 | "libc", 574 | "rand_chacha", 575 | "rand_core", 576 | ] 577 | 578 | [[package]] 579 | name = "rand_chacha" 580 | version = "0.3.1" 581 | source = "registry+https://github.com/rust-lang/crates.io-index" 582 | checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" 583 | dependencies = [ 584 | "ppv-lite86", 585 | "rand_core", 586 | ] 587 | 588 | [[package]] 589 | name = "rand_core" 590 | version = "0.6.4" 591 | source = "registry+https://github.com/rust-lang/crates.io-index" 592 | checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" 593 | dependencies = [ 594 | "getrandom", 595 | ] 596 | 597 | [[package]] 598 | name = "redox_syscall" 599 | version = "0.2.16" 600 | source = "registry+https://github.com/rust-lang/crates.io-index" 601 | checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" 602 | dependencies = [ 603 | "bitflags", 604 | ] 605 | 606 | [[package]] 607 | name = "restls" 608 | version = "0.1.0" 609 | dependencies = [ 610 | "anyhow", 611 | "blake3", 612 | "bytes", 613 | "clap 4.1.1", 614 | "futures-util", 615 | "hmac", 616 | "rand", 617 | "sha2", 618 | "structopt", 619 | "tokio", 620 | "tokio-util", 621 | "tracing", 622 | "tracing-subscriber", 623 | ] 624 | 625 | [[package]] 626 | name = "rustc-demangle" 627 | version = "0.1.23" 628 | source = "registry+https://github.com/rust-lang/crates.io-index" 629 | checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" 630 | 631 | [[package]] 632 | name = "rustix" 633 | version = "0.36.7" 634 | source = "registry+https://github.com/rust-lang/crates.io-index" 635 | checksum = "d4fdebc4b395b7fbb9ab11e462e20ed9051e7b16e42d24042c776eca0ac81b03" 636 | dependencies = [ 637 | "bitflags", 638 | "errno", 639 | "io-lifetimes", 640 | "libc", 641 | "linux-raw-sys", 642 | "windows-sys 0.42.0", 643 | ] 644 | 645 | [[package]] 646 | name = "scopeguard" 647 | version = "1.1.0" 648 | source = "registry+https://github.com/rust-lang/crates.io-index" 649 | checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" 650 | 651 | [[package]] 652 | name = "sha2" 653 | version = "0.10.6" 654 | source = "registry+https://github.com/rust-lang/crates.io-index" 655 | checksum = "82e6b795fe2e3b1e845bafcb27aa35405c4d47cdfc92af5fc8d3002f76cebdc0" 656 | dependencies = [ 657 | "cfg-if", 658 | "cpufeatures", 659 | "digest", 660 | ] 661 | 662 | [[package]] 663 | name = "sharded-slab" 664 | version = "0.1.4" 665 | source = "registry+https://github.com/rust-lang/crates.io-index" 666 | checksum = "900fba806f70c630b0a382d0d825e17a0f19fcd059a2ade1ff237bcddf446b31" 667 | dependencies = [ 668 | "lazy_static", 669 | ] 670 | 671 | [[package]] 672 | name = "signal-hook-registry" 673 | version = "1.4.0" 674 | source = "registry+https://github.com/rust-lang/crates.io-index" 675 | checksum = "e51e73328dc4ac0c7ccbda3a494dfa03df1de2f46018127f60c693f2648455b0" 676 | dependencies = [ 677 | "libc", 678 | ] 679 | 680 | [[package]] 681 | name = "slab" 682 | version = "0.4.7" 683 | source = "registry+https://github.com/rust-lang/crates.io-index" 684 | checksum = "4614a76b2a8be0058caa9dbbaf66d988527d86d003c11a94fbd335d7661edcef" 685 | dependencies = [ 686 | "autocfg", 687 | ] 688 | 689 | [[package]] 690 | name = "smallvec" 691 | version = "1.10.0" 692 | source = "registry+https://github.com/rust-lang/crates.io-index" 693 | checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" 694 | 695 | [[package]] 696 | name = "socket2" 697 | version = "0.4.9" 698 | source = "registry+https://github.com/rust-lang/crates.io-index" 699 | checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662" 700 | dependencies = [ 701 | "libc", 702 | "winapi", 703 | ] 704 | 705 | [[package]] 706 | name = "strsim" 707 | version = "0.8.0" 708 | source = "registry+https://github.com/rust-lang/crates.io-index" 709 | checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" 710 | 711 | [[package]] 712 | name = "strsim" 713 | version = "0.10.0" 714 | source = "registry+https://github.com/rust-lang/crates.io-index" 715 | checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" 716 | 717 | [[package]] 718 | name = "structopt" 719 | version = "0.3.26" 720 | source = "registry+https://github.com/rust-lang/crates.io-index" 721 | checksum = "0c6b5c64445ba8094a6ab0c3cd2ad323e07171012d9c98b0b15651daf1787a10" 722 | dependencies = [ 723 | "clap 2.34.0", 724 | "lazy_static", 725 | "structopt-derive", 726 | ] 727 | 728 | [[package]] 729 | name = "structopt-derive" 730 | version = "0.4.18" 731 | source = "registry+https://github.com/rust-lang/crates.io-index" 732 | checksum = "dcb5ae327f9cc13b68763b5749770cb9e048a99bd9dfdfa58d0cf05d5f64afe0" 733 | dependencies = [ 734 | "heck", 735 | "proc-macro-error", 736 | "proc-macro2", 737 | "quote", 738 | "syn 1.0.107", 739 | ] 740 | 741 | [[package]] 742 | name = "subtle" 743 | version = "2.4.1" 744 | source = "registry+https://github.com/rust-lang/crates.io-index" 745 | checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" 746 | 747 | [[package]] 748 | name = "syn" 749 | version = "1.0.107" 750 | source = "registry+https://github.com/rust-lang/crates.io-index" 751 | checksum = "1f4064b5b16e03ae50984a5a8ed5d4f8803e6bc1fd170a3cda91a1be4b18e3f5" 752 | dependencies = [ 753 | "proc-macro2", 754 | "quote", 755 | "unicode-ident", 756 | ] 757 | 758 | [[package]] 759 | name = "syn" 760 | version = "2.0.28" 761 | source = "registry+https://github.com/rust-lang/crates.io-index" 762 | checksum = "04361975b3f5e348b2189d8dc55bc942f278b2d482a6a0365de5bdd62d351567" 763 | dependencies = [ 764 | "proc-macro2", 765 | "quote", 766 | "unicode-ident", 767 | ] 768 | 769 | [[package]] 770 | name = "termcolor" 771 | version = "1.2.0" 772 | source = "registry+https://github.com/rust-lang/crates.io-index" 773 | checksum = "be55cf8942feac5c765c2c993422806843c9a9a45d4d5c407ad6dd2ea95eb9b6" 774 | dependencies = [ 775 | "winapi-util", 776 | ] 777 | 778 | [[package]] 779 | name = "textwrap" 780 | version = "0.11.0" 781 | source = "registry+https://github.com/rust-lang/crates.io-index" 782 | checksum = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" 783 | dependencies = [ 784 | "unicode-width", 785 | ] 786 | 787 | [[package]] 788 | name = "thread_local" 789 | version = "1.1.4" 790 | source = "registry+https://github.com/rust-lang/crates.io-index" 791 | checksum = "5516c27b78311c50bf42c071425c560ac799b11c30b31f87e3081965fe5e0180" 792 | dependencies = [ 793 | "once_cell", 794 | ] 795 | 796 | [[package]] 797 | name = "tokio" 798 | version = "1.29.1" 799 | source = "registry+https://github.com/rust-lang/crates.io-index" 800 | checksum = "532826ff75199d5833b9d2c5fe410f29235e25704ee5f0ef599fb51c21f4a4da" 801 | dependencies = [ 802 | "autocfg", 803 | "backtrace", 804 | "bytes", 805 | "libc", 806 | "mio", 807 | "num_cpus", 808 | "parking_lot", 809 | "pin-project-lite", 810 | "signal-hook-registry", 811 | "socket2", 812 | "tokio-macros", 813 | "windows-sys 0.48.0", 814 | ] 815 | 816 | [[package]] 817 | name = "tokio-macros" 818 | version = "2.1.0" 819 | source = "registry+https://github.com/rust-lang/crates.io-index" 820 | checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" 821 | dependencies = [ 822 | "proc-macro2", 823 | "quote", 824 | "syn 2.0.28", 825 | ] 826 | 827 | [[package]] 828 | name = "tokio-util" 829 | version = "0.7.4" 830 | source = "registry+https://github.com/rust-lang/crates.io-index" 831 | checksum = "0bb2e075f03b3d66d8d8785356224ba688d2906a371015e225beeb65ca92c740" 832 | dependencies = [ 833 | "bytes", 834 | "futures-core", 835 | "futures-io", 836 | "futures-sink", 837 | "futures-util", 838 | "hashbrown", 839 | "pin-project-lite", 840 | "slab", 841 | "tokio", 842 | "tracing", 843 | ] 844 | 845 | [[package]] 846 | name = "tracing" 847 | version = "0.1.37" 848 | source = "registry+https://github.com/rust-lang/crates.io-index" 849 | checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" 850 | dependencies = [ 851 | "cfg-if", 852 | "pin-project-lite", 853 | "tracing-attributes", 854 | "tracing-core", 855 | ] 856 | 857 | [[package]] 858 | name = "tracing-attributes" 859 | version = "0.1.23" 860 | source = "registry+https://github.com/rust-lang/crates.io-index" 861 | checksum = "4017f8f45139870ca7e672686113917c71c7a6e02d4924eda67186083c03081a" 862 | dependencies = [ 863 | "proc-macro2", 864 | "quote", 865 | "syn 1.0.107", 866 | ] 867 | 868 | [[package]] 869 | name = "tracing-core" 870 | version = "0.1.30" 871 | source = "registry+https://github.com/rust-lang/crates.io-index" 872 | checksum = "24eb03ba0eab1fd845050058ce5e616558e8f8d8fca633e6b163fe25c797213a" 873 | dependencies = [ 874 | "once_cell", 875 | "valuable", 876 | ] 877 | 878 | [[package]] 879 | name = "tracing-log" 880 | version = "0.1.3" 881 | source = "registry+https://github.com/rust-lang/crates.io-index" 882 | checksum = "78ddad33d2d10b1ed7eb9d1f518a5674713876e97e5bb9b7345a7984fbb4f922" 883 | dependencies = [ 884 | "lazy_static", 885 | "log", 886 | "tracing-core", 887 | ] 888 | 889 | [[package]] 890 | name = "tracing-subscriber" 891 | version = "0.3.16" 892 | source = "registry+https://github.com/rust-lang/crates.io-index" 893 | checksum = "a6176eae26dd70d0c919749377897b54a9276bd7061339665dd68777926b5a70" 894 | dependencies = [ 895 | "nu-ansi-term", 896 | "sharded-slab", 897 | "smallvec", 898 | "thread_local", 899 | "tracing-core", 900 | "tracing-log", 901 | ] 902 | 903 | [[package]] 904 | name = "typenum" 905 | version = "1.16.0" 906 | source = "registry+https://github.com/rust-lang/crates.io-index" 907 | checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" 908 | 909 | [[package]] 910 | name = "unicode-ident" 911 | version = "1.0.6" 912 | source = "registry+https://github.com/rust-lang/crates.io-index" 913 | checksum = "84a22b9f218b40614adcb3f4ff08b703773ad44fa9423e4e0d346d5db86e4ebc" 914 | 915 | [[package]] 916 | name = "unicode-segmentation" 917 | version = "1.10.0" 918 | source = "registry+https://github.com/rust-lang/crates.io-index" 919 | checksum = "0fdbf052a0783de01e944a6ce7a8cb939e295b1e7be835a1112c3b9a7f047a5a" 920 | 921 | [[package]] 922 | name = "unicode-width" 923 | version = "0.1.10" 924 | source = "registry+https://github.com/rust-lang/crates.io-index" 925 | checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" 926 | 927 | [[package]] 928 | name = "valuable" 929 | version = "0.1.0" 930 | source = "registry+https://github.com/rust-lang/crates.io-index" 931 | checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" 932 | 933 | [[package]] 934 | name = "vec_map" 935 | version = "0.8.2" 936 | source = "registry+https://github.com/rust-lang/crates.io-index" 937 | checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" 938 | 939 | [[package]] 940 | name = "version_check" 941 | version = "0.9.4" 942 | source = "registry+https://github.com/rust-lang/crates.io-index" 943 | checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" 944 | 945 | [[package]] 946 | name = "wasi" 947 | version = "0.11.0+wasi-snapshot-preview1" 948 | source = "registry+https://github.com/rust-lang/crates.io-index" 949 | checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" 950 | 951 | [[package]] 952 | name = "winapi" 953 | version = "0.3.9" 954 | source = "registry+https://github.com/rust-lang/crates.io-index" 955 | checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" 956 | dependencies = [ 957 | "winapi-i686-pc-windows-gnu", 958 | "winapi-x86_64-pc-windows-gnu", 959 | ] 960 | 961 | [[package]] 962 | name = "winapi-i686-pc-windows-gnu" 963 | version = "0.4.0" 964 | source = "registry+https://github.com/rust-lang/crates.io-index" 965 | checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" 966 | 967 | [[package]] 968 | name = "winapi-util" 969 | version = "0.1.5" 970 | source = "registry+https://github.com/rust-lang/crates.io-index" 971 | checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" 972 | dependencies = [ 973 | "winapi", 974 | ] 975 | 976 | [[package]] 977 | name = "winapi-x86_64-pc-windows-gnu" 978 | version = "0.4.0" 979 | source = "registry+https://github.com/rust-lang/crates.io-index" 980 | checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" 981 | 982 | [[package]] 983 | name = "windows-sys" 984 | version = "0.42.0" 985 | source = "registry+https://github.com/rust-lang/crates.io-index" 986 | checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" 987 | dependencies = [ 988 | "windows_aarch64_gnullvm 0.42.1", 989 | "windows_aarch64_msvc 0.42.1", 990 | "windows_i686_gnu 0.42.1", 991 | "windows_i686_msvc 0.42.1", 992 | "windows_x86_64_gnu 0.42.1", 993 | "windows_x86_64_gnullvm 0.42.1", 994 | "windows_x86_64_msvc 0.42.1", 995 | ] 996 | 997 | [[package]] 998 | name = "windows-sys" 999 | version = "0.48.0" 1000 | source = "registry+https://github.com/rust-lang/crates.io-index" 1001 | checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" 1002 | dependencies = [ 1003 | "windows-targets", 1004 | ] 1005 | 1006 | [[package]] 1007 | name = "windows-targets" 1008 | version = "0.48.1" 1009 | source = "registry+https://github.com/rust-lang/crates.io-index" 1010 | checksum = "05d4b17490f70499f20b9e791dcf6a299785ce8af4d709018206dc5b4953e95f" 1011 | dependencies = [ 1012 | "windows_aarch64_gnullvm 0.48.0", 1013 | "windows_aarch64_msvc 0.48.0", 1014 | "windows_i686_gnu 0.48.0", 1015 | "windows_i686_msvc 0.48.0", 1016 | "windows_x86_64_gnu 0.48.0", 1017 | "windows_x86_64_gnullvm 0.48.0", 1018 | "windows_x86_64_msvc 0.48.0", 1019 | ] 1020 | 1021 | [[package]] 1022 | name = "windows_aarch64_gnullvm" 1023 | version = "0.42.1" 1024 | source = "registry+https://github.com/rust-lang/crates.io-index" 1025 | checksum = "8c9864e83243fdec7fc9c5444389dcbbfd258f745e7853198f365e3c4968a608" 1026 | 1027 | [[package]] 1028 | name = "windows_aarch64_gnullvm" 1029 | version = "0.48.0" 1030 | source = "registry+https://github.com/rust-lang/crates.io-index" 1031 | checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" 1032 | 1033 | [[package]] 1034 | name = "windows_aarch64_msvc" 1035 | version = "0.42.1" 1036 | source = "registry+https://github.com/rust-lang/crates.io-index" 1037 | checksum = "4c8b1b673ffc16c47a9ff48570a9d85e25d265735c503681332589af6253c6c7" 1038 | 1039 | [[package]] 1040 | name = "windows_aarch64_msvc" 1041 | version = "0.48.0" 1042 | source = "registry+https://github.com/rust-lang/crates.io-index" 1043 | checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" 1044 | 1045 | [[package]] 1046 | name = "windows_i686_gnu" 1047 | version = "0.42.1" 1048 | source = "registry+https://github.com/rust-lang/crates.io-index" 1049 | checksum = "de3887528ad530ba7bdbb1faa8275ec7a1155a45ffa57c37993960277145d640" 1050 | 1051 | [[package]] 1052 | name = "windows_i686_gnu" 1053 | version = "0.48.0" 1054 | source = "registry+https://github.com/rust-lang/crates.io-index" 1055 | checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" 1056 | 1057 | [[package]] 1058 | name = "windows_i686_msvc" 1059 | version = "0.42.1" 1060 | source = "registry+https://github.com/rust-lang/crates.io-index" 1061 | checksum = "bf4d1122317eddd6ff351aa852118a2418ad4214e6613a50e0191f7004372605" 1062 | 1063 | [[package]] 1064 | name = "windows_i686_msvc" 1065 | version = "0.48.0" 1066 | source = "registry+https://github.com/rust-lang/crates.io-index" 1067 | checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" 1068 | 1069 | [[package]] 1070 | name = "windows_x86_64_gnu" 1071 | version = "0.42.1" 1072 | source = "registry+https://github.com/rust-lang/crates.io-index" 1073 | checksum = "c1040f221285e17ebccbc2591ffdc2d44ee1f9186324dd3e84e99ac68d699c45" 1074 | 1075 | [[package]] 1076 | name = "windows_x86_64_gnu" 1077 | version = "0.48.0" 1078 | source = "registry+https://github.com/rust-lang/crates.io-index" 1079 | checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" 1080 | 1081 | [[package]] 1082 | name = "windows_x86_64_gnullvm" 1083 | version = "0.42.1" 1084 | source = "registry+https://github.com/rust-lang/crates.io-index" 1085 | checksum = "628bfdf232daa22b0d64fdb62b09fcc36bb01f05a3939e20ab73aaf9470d0463" 1086 | 1087 | [[package]] 1088 | name = "windows_x86_64_gnullvm" 1089 | version = "0.48.0" 1090 | source = "registry+https://github.com/rust-lang/crates.io-index" 1091 | checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" 1092 | 1093 | [[package]] 1094 | name = "windows_x86_64_msvc" 1095 | version = "0.42.1" 1096 | source = "registry+https://github.com/rust-lang/crates.io-index" 1097 | checksum = "447660ad36a13288b1db4d4248e857b510e8c3a225c822ba4fb748c0aafecffd" 1098 | 1099 | [[package]] 1100 | name = "windows_x86_64_msvc" 1101 | version = "0.48.0" 1102 | source = "registry+https://github.com/rust-lang/crates.io-index" 1103 | checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" 1104 | -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "restls" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 7 | 8 | [dependencies] 9 | tokio = { version = "1.29.1", features = ["full"] } 10 | clap = "4.1.1" 11 | anyhow = "1.0.72" 12 | tracing = "0.1.26" 13 | structopt = "0.3.26" 14 | tracing-subscriber = "0.3.16" 15 | bytes = "1.3.0" 16 | hmac = "*" 17 | tokio-util = { version = "*", features = ["full"] } 18 | futures-util = "0.3.26" 19 | sha2 = "*" 20 | rand = "0.8.5" 21 | blake3 = { version = "1.4.1", features = ["traits-preview"] } 22 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2023, 3andne 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | * Redistributions of source code must retain the above copyright notice, 8 | this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above copyright 10 | notice, this list of conditions and the following disclaimer in the 11 | documentation and/or other materials provided with the distribution. 12 | * Neither the name of Restls nor the names of its contributors may be used to 13 | endorse or promote products derived from this software without specific 14 | prior written permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 20 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 24 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 25 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 26 | POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Restls 2 | 3 | A protocol that can disguise your proxy traffic as regular TLS traffic: 4 | 5 | * Disguise your proxy server [as any TLS server](./Restls%3A%20A%20Perfect%20Impersonation%20of%20TLS.md), such as `microsoft.com`. 6 | * Developed based on [utls](https://github.com/refraction-networking/utls), Disguise your [proxy client](https://github.com/3andne/Clash.Meta#restls) as a normal browser. 7 | * Use the `Restls-Script` protocol to conceal your proxy behavior and break characteristics such as "TLS in TLS". 8 | 9 | --- 10 | 11 | 一个可以把你的代理流量伪装成普通TLS流量的协议: 12 | 13 | * 把你的代理服务器[伪装成任何一个TLS服务器](./Restls%3A%20%E5%AF%B9TLS%E7%9A%84%E5%AE%8C%E7%BE%8E%E4%BC%AA%E8%A3%85.md),例如`microsoft.com`。 14 | * 基于[utls](https://github.com/refraction-networking/utls)开发,把你的[代理客户端](https://github.com/3andne/Clash.Meta#restls)伪装成一个普通的浏览器。 15 | * 使用Restls「剧本」协议,隐藏你的代理行为,破坏"TLS in TLS"等特征。 16 | 17 | ## Hide Your Proxy Traffic Behavior 18 | 19 | "TLS in TLS" and other proxy-specific traffic behaviors can be used to identify TLS-based protocols. A typical "TLS in TLS" connection is shown in the following diagram: 20 | 21 | "TLS in TLS"等代理特有流量行为可以被用来识别基于TLS的协议,一个典型的"TLS in TLS"连接如图所示: 22 | 23 | ![tls-in-tls](assets/tls-in-tls-illustration.png) 24 | 25 | Restls disrupts these obvious proxy behavior characteristics through the use of "restls-scripts". The following diagram shows Restls traffic disguised using `restls-scripts`: 26 | 27 | Restls通过「剧本」机制来破坏这些明显的代理行为特征,下图为使用「剧本」伪装后的Restls流量: 28 | 29 | ![restls-script](assets/restls-script.png) 30 | 31 | If you want to learn more about how `restls-scripts` work and how to design your own, please refer to: [Restls-Script: Hide Your Proxy Traffic Behavior](./Restls-Script:%20Hide%20Your%20Proxy%20Traffic%20Behavior.md) 32 | 33 | 如果你想了解更多关于「剧本」是如何运作的,以及如何设计自己的「剧本」,请参考:[Restls-Script: 隐藏你的代理行为](./Restls-Script:%20隐藏你的代理行为.md) 34 | 35 | ## Usage 36 | 37 | **Download [the latest release](https://github.com/3andne/restls/releases)** 38 | 39 | Or build it from source: 40 | 41 | ``` 42 | cargo build --release 43 | ``` 44 | 45 | 46 | 47 | Basic usage: 48 | ``` 49 | USAGE: 50 | restls --forward-to --listen --log-level --password --server-hostname --script