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

Define an array that contains all of the TLS versions #146

Closed
kevinburke opened this issue Sep 20, 2021 · 2 comments
Closed

Define an array that contains all of the TLS versions #146

kevinburke opened this issue Sep 20, 2021 · 2 comments

Comments

@kevinburke
Copy link
Contributor

kevinburke commented Sep 20, 2021

Postgres has configuration flags that let you set the minimum and the maximum TLS versions. I am thinking about implementing this with logic like this:

min_version = conn->ssl_min_version or 'TLS 1.2'
max_version = conn->ssl_max_version or None

versions = []
for version in rustls_tls_versions:
    if version >= min_version and (max_version is None or version <= max_version):
        versions.push(version)
rustls_client_config_builder_set_versions(versions)

The question is how to implement rustls_tls_versions... I can define all of the constants myself, in an array, but then if rustls adds TLS1.4, or TLS2, my array is going to be out of date, and people can't select a higher version, even if rustls can negotiate it..

It might be better if rustls-ffi declares an array containing all of the TLS versions. I can use that in my code to ensure that I'm not accidentally bounding the maximum TLS version that can be negotiated.

Alternatively, rustls-ffi could have a function that accepts a minimum and a maximum and returns me a uint16_t*.

@cpu
Copy link
Member

cpu commented Mar 30, 2023

This looks resolved w/ #242

@cpu
Copy link
Member

cpu commented Jun 28, 2023

I'm going to close this now that I have those perms on this repo. If I'm mistaken about this having been addressed in #242 I can reopen.

@cpu cpu closed this as completed Jun 28, 2023
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

No branches or pull requests

2 participants