feat (4/5): spec-correct WinRM HTTP/HTTPS transport + connection-oriented auth#23
Merged
irvingouj@Devolutions (irvingoujAtDevolution) merged 3 commits intoJun 23, 2026
Conversation
…ed auth Over plain HTTP, SSPI message sealing is used (application/HTTP-SPNEGO-session- encrypted). Over HTTPS, TLS provides confidentiality so the body is sent plain (application/soap+xml) and authentication is connection-oriented (RFC 4559): the connection is authenticated once during the handshake (the first operation rides the SPNEGO challenge legs) and every subsequent operation reuses that authenticated connection. requires_sspi_sealing() is therefore true only for plain HTTP. Key points: - SSPI INTEGRITY (sign) is requested unconditionally; CONFIDENTIALITY (seal) only when sealing. INTEGRITY over HTTPS lets the server trust the connection and produces the NTLM MIC / SPNEGO mechListMIC. - EPA channel binding (tls-server-end-point): learned from the server cert after a 401 and applied on a restarted auth sequence. - AlreadyComplete is handled consistently across all four transports (tokio direct, gateway, sync, web). - Fail fast on terminal auth rejection (401 -> PwshCoreError::Auth), try_join! so a failed handshake short-circuits, and the non-interactive client exits non-zero on failure / clean on success (command_completed is authoritative). - Basic over plain HTTP is refused unless --http-insecure is given.
…lding Add the 10-case transport_auth_matrix asserting the WinRM rule against a real server: HTTP+SSPI seals; HTTPS+SSPI is unsealed (TLS); Basic refused over plain HTTP unless forced, allowed (unsealed) over HTTPS. Helpers: sealed() detects the multipart/encrypted envelope, connected() detects pipeline completion. Also makes the shared e2e scaffolding auth-aware: e2e_pwsh_config gains default_auth_method(); native_pty_matrix and pty_harness use it (the default DC refuses Basic over HTTP), and fall back to the standard e2e host/creds out of the box.
3930b6c to
67051f2
Compare
test (5/5): transport × auth × sealing e2e matrix
f3b1f6f
into
stack/03-writeprogress-nil
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.
Stack 4 of 5 — base:
stack/03-writeprogress-nil(stacked on #22).Makes the WinRM transport/auth spec-correct:
application/HTTP-SPNEGO-session-encrypted).application/soap+xmlwith connection-oriented auth (RFC 4559) — the connection is authenticated once
during the handshake (first op rides the SPNEGO legs), then reused for every op.
only when sealing — this is what lets the server trust the unsealed HTTPS connection
(and yields the NTLM MIC / SPNEGO mechListMIC).
tls-server-end-point) learned from the server cert.AlreadyCompletehandled consistently across all four transports (tokio/gateway/sync/web).PwshCoreError::Auth),try_join!so a failed handshakeshort-circuits, and the non-interactive client exits non-zero on failure / clean on
success. Basic over plain HTTP refused unless
--http-insecure.Verified end-to-end against a real DC.