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

feat: basic tls support #26

Merged
merged 15 commits into from
Dec 11, 2023
Merged

feat: basic tls support #26

merged 15 commits into from
Dec 11, 2023

Conversation

jdockerty
Copy link
Owner

@jdockerty jdockerty commented Dec 8, 2023

Add TLS support via edge termination at the load balancer. The backend servers are still expected to be HTTP.

The main modification here is that listeners now pass back a TlsAcceptor, but only when they are HTTPS targets so that the other protocols are unaffected.

TODO: functionality between HTTP/HTTPS is shared for all except 2 lines of code to pull the tls_acceptor out. Can this be done in an elegant way via a wrapper function.


This implementation is likely not done in the best way, but as for a learning piece it was quite useful. I found that the Rust ecosystem around TLS is very confusing and there are a crates which seem okay but are abandoned. I opted to simply use tokio-native-tls here, rather than tokio-rustls, as it seemed simpler to use and fulfilled the goal of simply trying this out.

@jdockerty jdockerty self-assigned this Dec 8, 2023
@jdockerty jdockerty marked this pull request as ready for review December 11, 2023 12:26
@jdockerty jdockerty changed the title feat: tls support feat: basic tls support Dec 11, 2023
@jdockerty jdockerty merged commit 15ed5cb into main Dec 11, 2023
1 check passed
@jdockerty jdockerty deleted the feat/tls-support branch December 11, 2023 12:26
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.

1 participant