Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit08c2912

Browse files
authored
doc: the augmentation around SNI & certificate validation (#199)
This PR documents why the SNI is altered during TLS handshake and why acertificate SAN is compared against an alternate hostname.
1 parent5d648ef commit08c2912

File tree

1 file changed

+24
-0
lines changed
  • src/main/kotlin/com/coder/toolbox/util

1 file changed

+24
-0
lines changed

‎src/main/kotlin/com/coder/toolbox/util/TLS.kt‎

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,30 @@ fun sslContextFromPEMs(
8484
return sslContext
8585
}
8686

87+
/**
88+
* Netflix TLS Workaround — SNI & Hostname Validation
89+
*
90+
* Context:
91+
* - The Netflix servers we connect to rely on the SNI in the ClientHello
92+
* beyond just the typical use case of serving multiple hostnames from a
93+
* single IP. The alternate hostname for the SNI can contain underscores
94+
* (non-compliant for hostnames).
95+
* - The server always presents the same certificate, regardless of the SNI
96+
* - The certificate’s SAN entries do not match the server’s DNS name, and in
97+
* - Because of this mismatch, the TLS handshake fails unless we apply two
98+
* client-side workarounds:
99+
*
100+
* 1. SNI manipulation — we rewrite the SNI in the ClientHello via a custom
101+
* SSLSocketFactory. Even though the server’s cert does not vary by SNI,
102+
* connections fail if this rewrite is removed. The server’s TLS stack
103+
* appears to depend on the SNI being set in a particular way.
104+
*
105+
* 2. Hostname validation override — we relax certificate checks by allowing
106+
* an “alternate hostname” to be matched against the cert SANs. This avoids
107+
* rejections when the SAN does not align with the requested DNS name.
108+
*
109+
* See [this issue](https://github.com/coder/jetbrains-coder/issues/578) for more details.
110+
*/
87111
funcoderSocketFactory(settings:ReadOnlyTLSSettings):SSLSocketFactory {
88112
val sslContext= sslContextFromPEMs(settings.certPath, settings.keyPath, settings.caPath)
89113

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp