This allowed us to use AWS ELB with TLS termination.
We just copied _select_next_server(self) and modified around lines 47 and 59 (define and add ssl params at line 59).
A better solution would be change the default NATS client (in the main package):
- have a
default_dialer()method that wraps theasyncio.open_connection()call - add a
custom_dialerparameter in the__init__()constructor.self.dialershould be set toself.default_dialerifcustom_dialer is None. - call
self.dialer()instead ofasyncio.open_connection().