Skip to content
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

Access to TLS version #5407

Closed
mpg opened this issue Jan 10, 2022 · 1 comment
Closed

Access to TLS version #5407

mpg opened this issue Jan 10, 2022 · 1 comment
Assignees
Labels
bug size-s Estimated task size: small (~2d)

Comments

@mpg
Copy link
Contributor

mpg commented Jan 10, 2022

When we made the minor_ver and major_ver fields of ssl_context private in 3.0, this prevented applications from checking the negotiated version. (There is mbedtls_ssl_get_version() but it returns a string, so is less suitable for programmatic use.)

We should introduce a convenient way for applications to check the negotiated version.

I don't think we should make the fields public again, because in the future we may want to remove major_ver (it's always 3) and we may also want to remove minor_ver in builds that only support one version of TLS, in order to save code size and RAM. So instead we should have a getter function.

It is unclear if it's preferable for this function to return something similar to the existing major_ver and minor_ver or something from a new enum. A big drawback of the existing fields is they're uselessly exposing the on-the-wire format, which is confusing as minor_ver is off-by-one (it's 3 for TLS 1.2 and 4 for TLS 1.3). An enum with aptly-named constants would be cleaner, but might be more of a migration burden for people used to the existing fields.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug size-s Estimated task size: small (~2d)
Projects
None yet
Development

No branches or pull requests

4 participants