fix(agent/get.ps1): remove dead ServicePointManager.SecurityProtocol line (v1.3.9) #3
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
primatekuntech/triton-install!3
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/dead-tls-protocol-line-preflight"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
commit
72a118a("force TLS 1.2 for manage server download") added[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]3072to both the download function andInvoke-Preflightwhen the download function still usedInvoke-WebRequest/ServicePointManager. The very next commit (ef1c2ee) rewrote the download function to use rawSslStreamand correctly removed the now-useless line from it — but the same dead line was never removed fromInvoke-Preflight, which had already been usingSslStreamsince its introduction and thus never benefited from it in the first place.SslStream.AuthenticateAsClient(string)ignoresServicePointManagerentirely and negotiates via OS/Schannel default protocol selection.On a hardened Windows host where TLS 1.2 has been disabled at the Schannel/registry level, this line gave a false impression that TLS 1.2 was being pinned when it actually wasn't, for either
SslStreamcall in the file.Fix
Removed rather than replaced with explicit protocol enforcement, to match the sibling
Invoke-DownloadFromManageServer's ownAuthenticateAsClientcall — neitherSslStreamcall site in this file pins a protocol version explicitly; both rely on OS/Schannel defaults. Adding enforcement to only one of the two would introduce a new inconsistency, not fix an existing one — if real TLS-version pinning is wanted, it should be a separate follow-up touching both call sites via the 4-argAuthenticateAsClientoverload.Verification
SslStream.AuthenticateAsClient(String)'s remarks make no mention ofServicePointManager; that property only affectsHttpWebRequest/FtpWebRequest/SmtpClient), confirmed no other deadServicePointManagerreferences remain in this file, no findingsFixes amiryahaya/triton#337