Connecting to Cast devices failed with: Connection error: invalid peer certificate: Other(OtherError(UnsupportedCertVersion)) Many Cast devices (notably AV receivers with Chromecast built-in) serve a self-signed X.509 version 1 certificate on port 8009. rust_cast 0.21's NoCertificateVerification verifier accepts any certificate in verify_server_cert, but its signature checks delegate to rustls helpers that parse the certificate with webpki, which only supports version 3 certificates. The handshake therefore aborts for v1 device certificates; this affects every rustls-based rust_cast release (0.19+) and only devices happening to serve v3 certificates can connect. Vendors rust_cast 0.21.0 under crates/vendor with a minimal patch: the verifier's verify_tls12_signature/verify_tls13_signature now assert validity, matching the verifier's no-validation contract and the rustls danger verifier examples. Wired up via [patch.crates-io]; see crates/vendor/rust_cast/QBZ_PATCH.md for the full analysis and how to drop the patch once upstream releases the fix. Verified against a real device serving a v1 certificate (TLS 1.2, ECDHE-RSA-CHACHA20-POLY1305): handshake, receiver channel and heartbeat now establish; unpatched fails at the first channel write. cargo check/test -p qbz-cast pass (13 tests). Refs: rustls/rustls#1298, rustls/webpki#29, #439
92 lines
1.8 KiB
TOML
92 lines
1.8 KiB
TOML
# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO
|
|
#
|
|
# When uploading crates to the registry Cargo will automatically
|
|
# "normalize" Cargo.toml files for maximal compatibility
|
|
# with all versions of Cargo and also rewrite `path` dependencies
|
|
# to registry (e.g., crates.io) dependencies.
|
|
#
|
|
# If you are reading this file be aware that the original Cargo.toml
|
|
# will likely look very different (and much more reasonable).
|
|
# See Cargo.toml.orig for the original contents.
|
|
|
|
[package]
|
|
edition = "2024"
|
|
name = "rust_cast"
|
|
version = "0.21.0"
|
|
authors = ["Aleh Zasypkin <aleh.zasypkin@gmail.com>"]
|
|
build = "build.rs"
|
|
exclude = [
|
|
".github/*",
|
|
"examples/*",
|
|
"protobuf/*",
|
|
]
|
|
autolib = false
|
|
autobins = false
|
|
autoexamples = false
|
|
autotests = false
|
|
autobenches = false
|
|
description = "Library that allows you to communicate with Google Cast enabled devices (e.g. Chromecast)."
|
|
homepage = "https://github.com/azasypkin/rust-cast"
|
|
documentation = "https://docs.rs/crate/rust_cast/"
|
|
readme = "README.md"
|
|
keywords = [
|
|
"cast",
|
|
"chromecast",
|
|
"google",
|
|
]
|
|
categories = [
|
|
"api-bindings",
|
|
"hardware-support",
|
|
"multimedia",
|
|
]
|
|
license = "MIT"
|
|
repository = "https://github.com/azasypkin/rust-cast"
|
|
|
|
[features]
|
|
cast = []
|
|
thread_safe = []
|
|
|
|
[lib]
|
|
name = "rust_cast"
|
|
path = "src/lib.rs"
|
|
|
|
[dependencies.byteorder]
|
|
version = "1.5"
|
|
|
|
[dependencies.log]
|
|
version = "0.4"
|
|
|
|
[dependencies.protobuf]
|
|
version = "=3.7.2"
|
|
|
|
[dependencies.rustls]
|
|
version = "0.23"
|
|
|
|
[dependencies.rustls-native-certs]
|
|
version = "0.8"
|
|
|
|
[dependencies.serde]
|
|
version = "1"
|
|
features = ["derive"]
|
|
|
|
[dependencies.serde_json]
|
|
version = "1"
|
|
|
|
[dependencies.thiserror]
|
|
version = "2"
|
|
|
|
[dev-dependencies.ansi_term]
|
|
version = "0.12"
|
|
|
|
[dev-dependencies.docopt]
|
|
version = "1"
|
|
|
|
[dev-dependencies.env_logger]
|
|
version = "0.11"
|
|
|
|
[dev-dependencies.mdns-sd]
|
|
version = "0.17"
|
|
|
|
[build-dependencies.protobuf-codegen]
|
|
version = "=3.7.2"
|