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
21 lines
1.0 KiB
Plaintext
21 lines
1.0 KiB
Plaintext
MIT License
|
|
|
|
Copyright (c) 2016 Aleh Zasypkin
|
|
|
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
of this software and associated documentation files (the "Software"), to deal
|
|
in the Software without restriction, including without limitation the rights
|
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
copies of the Software, and to permit persons to whom the Software is
|
|
furnished to do so, subject to the following conditions:
|
|
|
|
The above copyright notice and this permission notice shall be included in all
|
|
copies or substantial portions of the Software.
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
SOFTWARE. |