Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 thantokio-rustls
, as it seemed simpler to use and fulfilled the goal of simply trying this out.