FlorianUekermann / rustls-acme

Apache License 2.0
136 stars 27 forks source link

Add an optional `tonic` feature with tonic compatibility helpers? #38

Closed hdevalence closed 10 months ago

hdevalence commented 1 year ago

We're using rustls-acme with tonic, and so far we wrote a some boilerplatey code to hook up rustls-acme to Tonic's batteries-included server implementation.

If we extracted that code and submitted a PR, would you be interested in upstreaming it under a feature flag?

I'm imagining implementing an extension trait, say AcmeTonicExt, so that instead of writing

Server::builder()
    .add_service(/* ... */)
    .add_service(/* ... */)
    .serve(addr)

for an http server, it would be possible to write

Server::builder()
    .add_service(/* ... */)
    .add_service(/* ... */)
    .serve_with_acme_tls(addr, acme_config)

for an auto-https server. The serve_with_acme_tls method would be provided by the extension trait, and handle gluing the rustls-acme methods to the tonic serve_with_incoming method.

FlorianUekermann commented 1 year ago

I'm definitely open to this. I'm not familiar with tonic, but if you send a PR or a more detailed sketch I'll happily review.

FlorianUekermann commented 10 months ago

It's been a while, I'll close here, assuming there's no interest anymore. Feel free to reopen.