Skip to content

Conversation

@cpu
Copy link
Member

@cpu cpu commented Sep 27, 2024

  • Restores the .gitignore that was lost in the repo contents shuffling.
  • Tries to fix dependabot - I think our YAML indentation was making this config a NOP (f'ing YAML...).
  • Updates Rustls to the latest release
  • Updates the make format target to also format the rust code for one-step convenience.
  • Implements SSL_alert_type_string() and SSL_alert_type_string_long() - these are very boring but serve as companions to the pre-existing SSL_alert_desc_string() and SSL_alert_desc_string_long() fns.
  • Partially implements SSL_set_cipher_list() by matching the partial impl for SSL_CTX_set_cipher_list().
  • Implements SSL_set_verify_result() to allow overriding the value returned by SSL_get_verify_result().
  • Stubs ~23 new functions that a clean build of Apache HTTPD trunk requires when loading mod_ssl. I've tried to place these in our stub section of entry.rs based on guesses on which I think we might actually want to impl one day. Most are things that are a clear no-go (SRP related, low level protocol details, etc)

This branch gets me to the point where httpd starts up without symbol resolution error but it certainly doesn't work yet. I've avoided updating the MATRIX.md to list which APIs HTTPD specifically needs because I'm not totally convinced it's a sensible target for this compat layer. The HTTPD mod_ssl code is quite old/crufty and so its interactions with the libssl APIs are much more nuanced and complex than we may wish to support. Mostly I was curious about the level of effort required vs continuing to support mod_tls & a rustls-ffi based solution.

@cpu cpu self-assigned this Sep 27, 2024
Copy link
Member

@ctz ctz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, overlooked this for a long, long time.

@cpu cpu force-pushed the cpu-httpd-thinking branch from ca165c7 to bab2d96 Compare February 28, 2025 18:43
@cpu
Copy link
Member Author

cpu commented Feb 28, 2025

Sorry, overlooked this for a long, long time.

I completely forgot about it myself 😆 Rebased & resolved the conflict in constants.rs.

@cpu
Copy link
Member Author

cpu commented Feb 28, 2025

rustls-libssl / Packaging (pull_request)Failing after 3m

Let's land #48 first and I'll rebase once more and merge this after.

cpu added 9 commits February 28, 2025 13:55
When the `rustls-libssl` code was moved to the root of the repo I think
the `.gitignore` got nuked. This commit restores the content we had
before the move.
This repo hasn't been receiving any dependabot PRs despite there being
updates available (e.g. Rustls). Spot checking against a config in
a repo that is working I _think_ the issue might be YAML whitespace
related... Let's try to match to the other repo's config exactly.
We don't need a specific minimum version of the 0.9 release stream.
This commit implements `SSL_alert_type_string()` and
`SSL_alert_type_string_long()`. These functions act similarly to the
existing `SSL_alert_desc_string()` and `SSL_alert_desc_string_long()`
functions except returning a (short or long) string for the alert level
(fatal, warning, unknown) instead of the alert description.
This commit adds a very simple implementation of `SSL_set_cipher_list`
that only returns success for the string "HIGH:!aNULL:!MD5", and
otherwise raises a not supported error.

This matches the pre-existing `SSL_CTX_set_cipher_list` that operated
similarly for a `SSL_CTX` as this new fn operates for a `SSL`.
Overrides the value that will be returned by `SSL_get_verify_result()`.
Is this smart to do? Probably not.
Adds stub implementations for a variety of functions HTTPD's
`mod_ssl.so` expects to be able to resolve:

  SSL_add_file_cert_subjects_to_stack
  SSL_client_hello_get0_ext,
  SSL_COMP_get_compression_methods,
  SSL_CTX_set0_tmp_dh_pkey,
  SSL_CTX_set_client_cert_cb,
  SSL_CTX_set_client_hello_cb,
  SSL_CTX_set_srp_cb_arg
  SSL_CTX_set_srp_username_callback,
  SSL_CTX_set_tlsext_ticket_key_evp_cb,
  SSL_get_ciphers,
  SSL_get_client_CA_list,
  SSL_get_finished,
  SSL_get_peer_finished,
  SSL_get_shared_ciphers,
  SSL_get_srp_userinfo,
  SSL_get_srp_username,
  SSL_peek,
  SSL_renegotiate,
  SSL_SESSION_get_compress_id,
  SSL_set_session_id_context,
  SSL_set_srp_server_param,
  SSL_state_string,
  SSL_state_string_long,
  SSL_verify_client_post_handshake,
@cpu cpu force-pushed the cpu-httpd-thinking branch from bab2d96 to 54a80a5 Compare February 28, 2025 18:58
@cpu cpu merged commit 7bc450f into rustls:main Feb 28, 2025
16 checks passed
@cpu cpu deleted the cpu-httpd-thinking branch February 28, 2025 19:02
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.

2 participants