cloudflare / pingora

A library for building fast, reliable and evolvable network services.
Apache License 2.0
21.67k stars 1.2k forks source link

How to setting SSL for multi domains #431

Open lebanggit opened 3 days ago

lebanggit commented 3 days ago

I was registried SSL for my domain at zerossl.com. I have follow this example:

https://github.com/cloudflare/pingora/blob/51516839f7155dd74d5cf93006ec1df9ea126b11/pingora-proxy/examples/load_balancer.rs#L85-L91

How to install SSL for multi domains?

CodyPubNub commented 3 days ago

There's a number of different ways to do this. One way I've landed on is to leverage the set_servername_callback method on the tls_settings. Here's an example of doing SNI: https://gist.github.com/CodyPubNub/199eda6d491527ee7df6cd6a8ea5aab2

I'd be curious to hear from the Cloudflare folks if there's a better way to do this though.