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

Start of SSL_CONF_* API support, Ubuntu 24.04 in CI #29

Merged
merged 3 commits into from
Jun 25, 2024

Conversation

cpu
Copy link
Member

@cpu cpu commented Jun 21, 2024

I had started to implement more of the commands and then realized my diff was getting pretty chonky so to start with I've pulled out all of the scaffolding and just two initial supported commands: MinProtocol and MaxProtocol.

There's an included C program/unit test that runs through some various SSL_CONF_CTX_set1_prefix and SSL_CONF_CTX_set_flags setups, matching the SSL_CONF_cmd_value_type output for supported options between our impl and OpenSSL. This was a useful exercise as I discovered this API has some interesting nuance to it. Initially I intended to not support setting a prefix, but it turned out the command matching/selection logic is fairly tied to the notion of the prefix in use (default or otherwise) and so I implemented it after all. In sum we now support all the SSL_CONF_* APIs in some manner except SSL_CONF_cmd_argv (this one felt too niche to care about at this stage.).

For Nginx this API surface is used to support the ssl_conf_command directive. Using that for an integration test is fairly straightforward, but the Nginx version on Ubuntu 22.04 doesn't support this directive :-( To resolve this I tacked on an update to CI that adds Ubuntu 24.04. When we added initial 24.04 support there wasn't a runner image available. That's since been resolved. The new ssl_conf_command is then written to run conditionally based on the nginx version installed, skipping on 22.04 and running on 24.04.

There's one additional rub with the 24.04 testing: as mentioned in another issue session resumption w/ Nginx 24.04 and our compat .so doesn't seem to be working correctly. We should fix this, but in the meantime I've updated the nginx unit tests to skip the resumption tests when using Nginx 1.24+.

Updates #22

@cpu cpu self-assigned this Jun 21, 2024
@cpu
Copy link
Member Author

cpu commented Jun 21, 2024

Build+test (stable, ubuntu-latest) Expected — Waiting for status to be reported

Will need to admin merge this one since the job names change out from under the branch protection rules.

@cpu cpu force-pushed the cpu-ssl-conf-api branch from bd723bf to 43eedbf Compare June 23, 2024 16:52
rustls-libssl/tests/config.c Show resolved Hide resolved
cpu added 3 commits June 25, 2024 12:22
This commit introduces the scaffolding for the `SSL_CONF_*` APIs that
were previously stubbed. All of the API fns with the exception of
`SSL_CONF_cmd_argv` are now implemented as of this commit.

Note: we do not yet suppor the vast majority of possible `SSL_CONF_cmd`
options. To start, only `MinProtocol` and `MaxProtocol` are supported.
Additional commands will be supported in subsequent commits.
* Replace `ubuntu-latest` with `ubuntu-22.04` - we expect that soon that
  tag will point at 24.04 and we want to keep testing w/ 22.04
  explicitly
* Add `ubuntu-24.04` - in the future, once the switch mentioned above
  has happened, we can replace this with `ubuntu-latest` once more.
* Add a helper to `tests/runner.rs` for checking the Nginx version. We
  use this to conditionally skip the TLS session resumption nginx tests
  when running on 24.04 with Nginx 1.24+ - there's an outstanding issue
  where resumption doesn't work with this nginx version.
We want to test the `ssl_conf_command` directive, but this is only
available in nginx 1.24+.

This commit adds a 1.24 specific config file and updates the test runner
so we can spin up and test a nginx 1.24 server with this config when
available.

For now we test the `MinProtocol` and `MaxProtocol` OpenSSL CONF_CTX
commands that the compat shim supports.
@cpu cpu force-pushed the cpu-ssl-conf-api branch from 43eedbf to 496a821 Compare June 25, 2024 16:22
@cpu
Copy link
Member Author

cpu commented Jun 25, 2024

@ctz Do you want to re-review before I merge?

@cpu cpu merged commit ff3c6e5 into rustls:main Jun 25, 2024
14 checks passed
@cpu cpu deleted the cpu-ssl-conf-api branch June 25, 2024 16:50
@cpu
Copy link
Member Author

cpu commented Jun 25, 2024

Admin merged + fixed up the branch protection rules afterwards.

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