Skip to content

Default desktop port to 3389 if not specified#35304

Merged
zmb3 merged 1 commit intomasterfrom
zmb3/desktop-port
Dec 4, 2023
Merged

Default desktop port to 3389 if not specified#35304
zmb3 merged 1 commit intomasterfrom
zmb3/desktop-port

Conversation

@zmb3
Copy link
Copy Markdown
Collaborator

@zmb3 zmb3 commented Dec 4, 2023

When specifying hosts in the config file, Teleport will automatically set the port to 3389 if it is
not otherwise specified. This behavior is different with tctl or our API - in these cases, we don't
default to the correct port, and attempts to connect to these desktops will fail.

We now parse the desktop addr at connect time and
set the port if it is not provided.

Closes #31646

changelog: Desktop connections default to RDP port 3389 if not otherwise specified.

When specifying hosts in the config file, Teleport
will automatically set the port to 3389 if it is
not otherwise specified. This behavior is different
with tctl or our API - in these cases, we don't
default to the correct port, and attempts to connect
to these desktops will fail.

We now parse the desktop addr at connect time and
set the port if it is not provided.

Closes #31646
Copy link
Copy Markdown
Contributor

@ibeckermayer ibeckermayer left a comment

Choose a reason for hiding this comment

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

I spent a bit too long trying to decipher how ParseHostPortAddr ultimately works, I created this docstring which you can consider adding:

// ParseHostPortAddr expects a string in the format "[(tcp | http | https)://]host[:port]"
// and returns a [*NetAddr] or an error. If the `hostport` string contains a valid port, this
// port is used regardless of the value of `defaultPort`.
//
// If the `hostport` does not contain a port, the function uses the provided `defaultPort`,
// unless `defaultPort` is -1, in which case the function returns an error.
//
// The `AddrNetwork` of the returned [*NetAddr] is set to "tcp" by default if no scheme was provided,
// and the `Addr` is set to the host and port joined by a colon. Providing a string in a format
// besides the one described above is not supported and may result in unexpected behavior.

@zmb3 zmb3 added this pull request to the merge queue Dec 4, 2023
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Dec 4, 2023
@zmb3 zmb3 added this pull request to the merge queue Dec 4, 2023
Merged via the queue into master with commit d556e41 Dec 4, 2023
@zmb3 zmb3 deleted the zmb3/desktop-port branch December 4, 2023 23:16
@public-teleport-github-review-bot
Copy link
Copy Markdown

@zmb3 See the table below for backport results.

Branch Result
branch/v12 Create PR
branch/v13 Create PR
branch/v14 Create PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Automatically assume the default RDP port for non-AD Desktop access

3 participants