-
Notifications
You must be signed in to change notification settings - Fork 145
feat(tls): allow configuring TLS versions and cipher suites #575
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Expose configuration options for TLS MinVersion, MaxVersion, and CipherSuites backed by crypto/tls. This allows LiveKit to interoperate with providers that require non-default or legacy TLS configurations.
|
|
dennwc
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, just a few minor adjustments.
| Certs []TLSCert `yaml:"certs"` | ||
| KeyLog string `yaml:"key_log"` | ||
|
|
||
| MinVersion string `yaml:"min_version"` // min TLS version, accepts: "1.0", "1.1", "1.2", "1.3" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Values like 1.0 are dangerous in YAML, since they will be interpreted as a number by default. The user must then know to set it to "1.0" (a string).
So I'd propose we settle on accepting just tls1.0 and/or TLS1.0.
|
|
||
| // ParseCipherSuites parses cipher suite names to uint16 IDs. | ||
| // Logs a warning for each insecure cipher suite configured. | ||
| func ParseCipherSuites(suites []string, log logger.Logger) ([]uint16, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| func ParseCipherSuites(suites []string, log logger.Logger) ([]uint16, error) { | |
| func ParseCipherSuites(log logger.Logger, suites []string) ([]uint16, error) { |
|
|
||
| // ParseCipherSuites parses cipher suite names to uint16 IDs. | ||
| // Logs a warning for each insecure cipher suite configured. | ||
| func ParseCipherSuites(suites []string, log logger.Logger) ([]uint16, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| func ParseCipherSuites(suites []string, log logger.Logger) ([]uint16, error) { | |
| func parseCipherSuites(suites []string, log logger.Logger) ([]uint16, error) { |
Can be unexported, since these are only used it this package.
|
|
||
| // ParseTLSVersion parses a TLS version string to its uint16 constant. | ||
| // Accepts formats: "1.0", "1.1", "1.2", "1.3" or "TLS 1.0", "TLS 1.1", "TLS 1.2", "TLS 1.3". | ||
| func ParseTLSVersion(version string) (uint16, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| func ParseTLSVersion(version string) (uint16, error) { | |
| func parseTLSVersion(version string) (uint16, error) { |
Same here - can be unexported.
Expose configuration options for TLS MinVersion, MaxVersion, and CipherSuites backed by crypto/tls. This allows LiveKit to interoperate with providers that require non-default or legacy TLS configurations.