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

Ubuntu 24.04 & Nginx 1.24.0 compat work #20

Merged
merged 10 commits into from
May 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 15 additions & 15 deletions rustls-libssl/MATRIX.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,16 @@
| `SSL_COMP_get_name` | | | |
| `SSL_COMP_set0_compression_methods` | | | |
| `SSL_CONF_CTX_clear_flags` | | | |
| `SSL_CONF_CTX_finish` | | | |
| `SSL_CONF_CTX_free` | | | |
| `SSL_CONF_CTX_new` | | | |
| `SSL_CONF_CTX_finish` | | | :exclamation: [^stub] |
| `SSL_CONF_CTX_free` | | | :exclamation: [^stub] |
| `SSL_CONF_CTX_new` | | | :exclamation: [^stub] |
| `SSL_CONF_CTX_set1_prefix` | | | |
| `SSL_CONF_CTX_set_flags` | | | |
| `SSL_CONF_CTX_set_flags` | | | :exclamation: [^stub] |
| `SSL_CONF_CTX_set_ssl` | | | |
| `SSL_CONF_CTX_set_ssl_ctx` | | | |
| `SSL_CONF_cmd` | | | |
| `SSL_CONF_CTX_set_ssl_ctx` | | | :exclamation: [^stub] |
| `SSL_CONF_cmd` | | | :exclamation: [^stub] |
| `SSL_CONF_cmd_argv` | | | |
| `SSL_CONF_cmd_value_type` | | | |
| `SSL_CONF_cmd_value_type` | | | :exclamation: [^stub] |
| `SSL_CTX_SRP_CTX_free` [^deprecatedin_3_0] [^srp] | | | |
| `SSL_CTX_SRP_CTX_init` [^deprecatedin_3_0] [^srp] | | | |
| `SSL_CTX_add1_to_CA_list` | | | |
Expand Down Expand Up @@ -232,8 +232,8 @@
| `SSL_SESSION_get_max_fragment_length` | | | |
| `SSL_SESSION_get_protocol_version` | | | |
| `SSL_SESSION_get_ticket_lifetime_hint` | | | |
| `SSL_SESSION_get_time` | | | |
| `SSL_SESSION_get_timeout` | | | |
| `SSL_SESSION_get_time` | | | :white_check_mark: |
| `SSL_SESSION_get_timeout` | | | :white_check_mark: |
| `SSL_SESSION_has_ticket` | | | |
| `SSL_SESSION_is_resumable` | | | |
| `SSL_SESSION_new` | | | |
Expand All @@ -243,15 +243,15 @@
| `SSL_SESSION_set1_alpn_selected` | | | |
| `SSL_SESSION_set1_hostname` | | | |
| `SSL_SESSION_set1_id` | | | |
| `SSL_SESSION_set1_id_context` | | | |
| `SSL_SESSION_set1_id_context` | | | :white_check_mark: |
| `SSL_SESSION_set1_master_key` | | | |
| `SSL_SESSION_set1_ticket_appdata` | | | |
| `SSL_SESSION_set_cipher` | | | |
| `SSL_SESSION_set_ex_data` | | | |
| `SSL_SESSION_set_max_early_data` | | | |
| `SSL_SESSION_set_protocol_version` | | | |
| `SSL_SESSION_set_time` | | | |
| `SSL_SESSION_set_timeout` | | | |
| `SSL_SESSION_set_time` | | | :white_check_mark: |
| `SSL_SESSION_set_timeout` | | | :white_check_mark: |
| `SSL_SESSION_up_ref` | | :white_check_mark: | :white_check_mark: |
| `SSL_SRP_CTX_free` [^deprecatedin_3_0] [^srp] | | | |
| `SSL_SRP_CTX_init` [^deprecatedin_3_0] [^srp] | | | |
Expand Down Expand Up @@ -318,7 +318,7 @@
| `SSL_get1_peer_certificate` | :white_check_mark: | :white_check_mark: | :white_check_mark: |
| `SSL_get1_session` | | :white_check_mark: | :white_check_mark: |
| `SSL_get1_supported_ciphers` | | | |
| `SSL_get_SSL_CTX` | | | |
| `SSL_get_SSL_CTX` | | | :white_check_mark: |
| `SSL_get_all_async_fds` | | | |
| `SSL_get_async_status` | | | |
| `SSL_get_certificate` | :white_check_mark: | :white_check_mark: | :white_check_mark: |
Expand Down Expand Up @@ -409,7 +409,7 @@
| `SSL_rstate_string` | | | |
| `SSL_rstate_string_long` | | | |
| `SSL_select_next_proto` | | :white_check_mark: | :white_check_mark: |
| `SSL_sendfile` | | | |
| `SSL_sendfile` | | | :exclamation: [^stub] |
| `SSL_session_reused` | | :white_check_mark: | :white_check_mark: |
| `SSL_set0_CA_list` | | | |
| `SSL_set0_rbio` | | | :white_check_mark: |
Expand Down Expand Up @@ -498,7 +498,7 @@
| `SSL_use_certificate_file` | | | |
| `SSL_use_psk_identity_hint` [^psk] | | | |
| `SSL_verify_client_post_handshake` | | | |
| `SSL_version` | | | |
| `SSL_version` | | | :white_check_mark: |
| `SSL_waiting_for_async` | | | |
| `SSL_want` | | | :white_check_mark: |
| `SSL_write` | :white_check_mark: | :white_check_mark: | :white_check_mark: |
Expand Down
18 changes: 16 additions & 2 deletions rustls-libssl/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@ target/VERSION: ALWAYS
echo "This is rustls-libssl `git describe --always`\nDate: `date`\nIncorporating:" > $@
$(CARGO) tree >> $@

test-package: test-package-deb
test-package: test-package-deb-22 test-package-deb-24

test-package-deb: package-deb
test-package-deb-22: package-deb
mkdir --parents target/dist/test/ubuntu-22
cp target/dist/rustls-libssl_*.deb \
dist/test/deb-ubuntu-22/* \
Expand All @@ -89,6 +89,20 @@ test-package-deb: package-deb
docker build --tag $@ target/dist/test/ubuntu-22
cd target/dist/test/ubuntu-22 && ./run-test.sh $@

test-package-deb-24: package-deb
mkdir --parents target/dist/test/ubuntu-24
cp target/dist/rustls-libssl_*.deb \
dist/test/deb-ubuntu-22/* \
test-ca/rsa/server.key \
test-ca/rsa/server.cert \
test-ca/rsa/ca.cert \
target/dist/test/ubuntu-24
# copy deb-ubuntu-24 files on top of -22 ones
cp dist/test/deb-ubuntu-24/* \
target/dist/test/ubuntu-24
docker build --tag $@ target/dist/test/ubuntu-24
cd target/dist/test/ubuntu-24 && ./run-test.sh $@

ALWAYS: ;

.PHONY: all clean test integration format format-check package package-deb ALWAYS test-package test-package-deb
15 changes: 15 additions & 0 deletions rustls-libssl/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,13 @@ const ENTRYPOINTS: &[&str] = &[
"SSL_CIPHER_get_version",
"SSL_CIPHER_standard_name",
"SSL_clear_options",
"SSL_CONF_cmd",
"SSL_CONF_cmd_value_type",
"SSL_CONF_CTX_finish",
"SSL_CONF_CTX_free",
"SSL_CONF_CTX_new",
"SSL_CONF_CTX_set_flags",
"SSL_CONF_CTX_set_ssl_ctx",
"SSL_connect",
"SSL_ctrl",
"SSL_CTX_add_client_CA",
Expand Down Expand Up @@ -141,6 +148,7 @@ const ENTRYPOINTS: &[&str] = &[
"SSL_get_servername_type",
"SSL_get_session",
"SSL_get_shutdown",
"SSL_get_SSL_CTX",
"SSL_get_state",
"SSL_get_verify_depth",
"SSL_get_verify_result",
Expand All @@ -157,9 +165,15 @@ const ENTRYPOINTS: &[&str] = &[
"SSL_read",
"SSL_read_early_data",
"SSL_select_next_proto",
"SSL_sendfile",
"SSL_SESSION_free",
"SSL_SESSION_get_id",
"SSL_SESSION_get_time",
"SSL_SESSION_get_timeout",
"SSL_session_reused",
"SSL_SESSION_set1_id_context",
"SSL_SESSION_set_time",
"SSL_SESSION_set_timeout",
"SSL_SESSION_up_ref",
"SSL_set0_rbio",
"SSL_set0_wbio",
Expand All @@ -183,6 +197,7 @@ const ENTRYPOINTS: &[&str] = &[
"SSL_use_certificate",
"SSL_use_PrivateKey",
"SSL_use_PrivateKey_file",
"SSL_version",
"SSL_want",
"SSL_write",
"SSL_write_early_data",
Expand Down
2 changes: 1 addition & 1 deletion rustls-libssl/dist/bin/rustls-libssl-nginx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
NGINX_DROP_IN_DIR=/etc/systemd/system/nginx.service.d/
DROP_IN=/usr/share/rustls-libssl/50-rustls-libssl.conf

distro=$(lsb_release --short --id 2>/dev/null || echo "Unknown")
distro=$(. /etc/lsb-release && echo $DISTRIB_ID || echo "Unknown")

case $distro in
"Debian")
Expand Down
4 changes: 2 additions & 2 deletions rustls-libssl/dist/test/deb-ubuntu-22/run-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ set -e
TAG="$1"

docker run --interactive --publish 8443:443 "$TAG" &
DOCKER_ID=$!
sleep 2

output_got=$(curl --cacert ca.cert https://localhost:8443/)

kill "$DOCKER_ID"
docker stop "$(docker ps --quiet)"

diff --unified --report-identical-files <(echo "hello world") <(echo "$output_got")
14 changes: 14 additions & 0 deletions rustls-libssl/dist/test/deb-ubuntu-24/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM ubuntu:24.04
ENV DEBIAN_FRONTEND=noninteractive
RUN apt update && apt install -y curl nginx
ADD rustls-libssl_*.deb /root
ADD --chown=nobody:nogroup server.cert /
ADD --chown=nobody:nogroup server.key /
ADD ca.cert /root
ADD nginx.conf /etc/nginx/sites-enabled/default
RUN dpkg -i /root/rustls-libssl_*.deb

# nb, this only affects systemd runs, but check it works at least
RUN rustls-libssl-nginx enable

CMD /usr/bin/with-rustls-libssl nginx -g 'daemon off;'
Loading