Skip to content

Commit 3f00ca5

Browse files
committed
fix(pam-rdp): bypass mstsc TLS cert validation in generated .rdp
Generated .rdp file now sets `authentication level:i:0`. mstsc validates the server's TLS cert by default and rejects the bridge's self-signed cert with "unexpected server authentication certificate", terminating the connection before the X.224 handshake. FreeRDP and Windows App don't enforce the same check, so this only manifests for mstsc users. Verified through mstsc on a Windows EC2 connecting via gateway+relay.
1 parent 9357a92 commit 3f00ca5

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

packages/pam/local/rdp-proxy.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,9 +313,14 @@ func writeRDPFile(listenPort int, sessionID, username string) (string, error) {
313313
}
314314
path := filepath.Join(dir, filename)
315315

316+
// authentication level:i:0 -> mstsc connects even if it can't verify the
317+
// server's TLS cert. The bridge presents a self-signed cert, so without
318+
// this mstsc terminates with "unexpected server authentication certificate".
319+
// FreeRDP/Windows App ignore the cert by default; mstsc is the strict one.
316320
content := fmt.Sprintf(
317321
"full address:s:127.0.0.1:%d\r\n"+
318-
"username:s:%s\r\n",
322+
"username:s:%s\r\n"+
323+
"authentication level:i:0\r\n",
319324
listenPort,
320325
username,
321326
)

0 commit comments

Comments
 (0)