Skip to content

fix: don't apply Coder TLS alternate hostname to JetBrains IDE feed client#311

Merged
fioan89 merged 2 commits into
mainfrom
skip-san-hostname-checking-for-metadata-feeds
May 28, 2026
Merged

fix: don't apply Coder TLS alternate hostname to JetBrains IDE feed client#311
fioan89 merged 2 commits into
mainfrom
skip-san-hostname-checking-for-metadata-feeds

Conversation

@fioan89
Copy link
Copy Markdown
Collaborator

@fioan89 fioan89 commented May 27, 2026

The IdeFeedManager fetches IDE metadata from data.services.jetbrains.com but was reusing the default Coder OkHttp client which is for Coder endpoints and it applies the user-configured TLS alternate hostname. That setting is meant for the Coder deployment and should not affect requests to JetBrains.

The fix moves the JetBrains client construction into IdeFeedManager where it belongs, with only what it actually needs: user-agent, logging, proxy, retry. No Coder TLS context or hostname verifier touches that traffic anymore.

…lient

The IdeFeedManager fetches IDE metadata from data.services.jetbrains.com
but was reusing the default Coder OkHttp client, which applies the
user-configured TLS alternate hostname. That setting is meant for the
Coder deployment and should not affect requests to JetBrains.

Introduce CoderHttpClientBuilder.defaultWithoutTlsAlternateHostname and
use it from IdeFeedManager so the JetBrains feed client verifies the
real hostname.
if (feedService != null) return@lazy feedService

val okHttpClient = CoderHttpClientBuilder.default(context)
val okHttpClient = CoderHttpClientBuilder.defaultWithoutTlsAlternateHostname(context)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Seems kinda hacky. Limited knowledge of the plugin, couldn't we add a separate client builder altogether and use that instead of overloading the CoderHttpClient Builder?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Definitely - we can. Let me play a bit with the code but I think the tradeoff would be a bit of duplication around the interceptor setup.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Done. I think the result is quite nice, and I managed to avoid duplication.

CoderHttpClientBuilder is for Coder endpoints — having it grow a
"without TLS alternate hostname" variant just to serve the JetBrains
data services feed was a smell. Move the JetBrains client construction
into IdeFeedManager where it belongs, with only what it actually needs:
user-agent, logging, proxy, retry. No Coder TLS context or hostname
verifier touches that traffic anymore.
Copy link
Copy Markdown

@zenithwolf1000 zenithwolf1000 left a comment

Choose a reason for hiding this comment

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

Smooth change, nice!

@fioan89 fioan89 merged commit 54c1d54 into main May 28, 2026
6 checks passed
@fioan89 fioan89 deleted the skip-san-hostname-checking-for-metadata-feeds branch May 28, 2026 18:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants