Repository navigation
Conversation
The pinned server certificate was only compared inside the sslErrors() handler. QNetworkAccessManager does not emit sslErrors() when the presented certificate chains to a CA trusted by the system and matches the host name, so in that case the pin was never checked and the request (including uniqueid and, for launch/resume, the remote input key) was sent to whoever answered. This can happen behind a TLS inspection proxy with an installed root CA, or with any publicly trusted certificate for the host's address. Check the peer certificate against the pin in the encrypted() signal, which fires after the handshake and before any request data is sent, and abort the request on mismatch. The failure is reported the same way as an SSL handshake failure (401 "Server certificate mismatch"). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Member
|
This behavior is intentional. It's intended that someone can have Sunshine provide a publicly/privately trusted certificate and clients can use that to authenticate connections to the host. |
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.
NvHTTPcompares the pinned server certificate only inhandleSslErrors().QNetworkAccessManagerdoesn't emitsslErrors()when the presented chain is valid against the system CAs and matches the host name, so in that case the pin is never checked. The request, includinguniqueidand therikeyon launch/resume, then goes to whoever answered. Examples are TLS inspection proxies with an installed root, or a publicly trusted certificate for the host's address.This checks the peer certificate against the pin in
QNetworkReply::encrypted, which fires after the handshake and before the request is sent, and aborts on mismatch. A mismatch is reported exactly like an SSL handshake failure (401 "Server certificate mismatch"), so the existing HTTP fallback and re-pair flow is unchanged.Note: this relies on a fresh handshake per request. That is already the case on every Qt version, because connection caching is disabled.
Tested with a harness linked against the release build's objects, calling
NvHTTP::getAppList()against a local TLS server:🤖 Generated with Claude Code