Skip to content

Conversation

@TheBestTvarynka
Copy link

Hi,

During the debugging, I faced the following error message when connecting using mstscex:

image

The error happened right after sending the erectDomainrequest packet by mstsc:

image

It turned out that the problem was in the ConnectionRequest PDU sent from the Devolutions Gateway to the target RDP server. The mstsc expects the ConnectionRequest flags to be the same. The connection fails when the proxy alters security protocol flags.
That is what I came up with.

I found a very similar problem here: https://serverfault.com/a/720161:

The error was in this step:

The proxy receives and modifies (if necessary) the ConnectionRequestPDU message of the RDP Protocol to ensure the SupportedProtocol flags are set to ProtocolHybrid & ProtocolSSL. This will ensure the use of CredSSP. That is forwarded to srvPPassTest2.

As it turns out, I also had to set the ProtocolHybridEx flag in the ConnectionRequestPDU. I'm guessing this is because the forwarded messages, the ones after the TSCredential, care about this flag.

That being the case, I've decided to just forward the flags used by the client, instead of building them myself. If the ProtocolHybrid flag isn't set, I'll error out gently since we require Network Level Authentication (NLA) be used.

cc @awakecoding

@TheBestTvarynka TheBestTvarynka changed the title fix(devolutions-gateway): enable SecurityProtocol::SSL fix(devolutions-gateway): RDP proxy: enable SSL proocol Nov 14, 2025
@TheBestTvarynka TheBestTvarynka marked this pull request as ready for review November 14, 2025 18:49
@TheBestTvarynka TheBestTvarynka changed the title fix(devolutions-gateway): RDP proxy: enable SSL proocol fix(devolutions-gateway): RDP proxy: enable SSL protocol Nov 14, 2025
@CBenoit CBenoit marked this pull request as draft November 15, 2025 09:17
@CBenoit CBenoit changed the title fix(devolutions-gateway): RDP proxy: enable SSL protocol fix(dgw): enable SSL protocol in RDP proxy Nov 15, 2025
@CBenoit
Copy link
Member

CBenoit commented Nov 15, 2025

Marking as draft to avoid merging in your other branch by mistake

@TheBestTvarynka
Copy link
Author

@CBenoit, I don't know why the CI failed 😕. All tests are green on my Windows machine. The error message in the CI logs is not clear. I wanted just to re-run the failed job, but I do not have enough permissions to do so

@RRRadicalEdward
Copy link
Collaborator

@CBenoit, I don't know why the CI failed 😕. All tests are green on my Windows machine. The error message in the CI logs is not clear. I wanted just to re-run the failed job, but I do not have enough permissions to do so

@TheBestTvarynka I did the re-run.

@TheBestTvarynka TheBestTvarynka marked this pull request as ready for review November 28, 2025 15:12
@TheBestTvarynka
Copy link
Author

@CBenoit, I think you can merge this PR now. The CI is green 💚

@CBenoit CBenoit changed the base branch from dev/rdp-kerberos-credentials-injection to master November 30, 2025 18:44
Copy link
Member

@CBenoit CBenoit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@CBenoit CBenoit enabled auto-merge (squash) December 1, 2025 14:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants