<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Hi there,<br class=""><br class="">Does anyone have any examples of how to use sni_hosts correctly in TransportOpts in cowboy:start_tls/3?<div class=""><br class=""></div><div class="">I want to use different certs for respective diferent hostnames, and I'm having trouble deciphering the docs as the definition seems spread across cowboy, ranch and erlang:ssl. From what I can tell the underlying erlang:ssl wants this:<div class=""><br class=""></div><div class="">{ sni_hosts, [ { hostname(), [ ssl_option() ] } ] } </div><div class=""><br class=""></div><div class="">which seems like it should work like e.g.<div class=""><br class=""></div><div class="">{ sni_hosts, [ { "hostname1", [ { certfile, Certfile1 }, { keyfile, Keyfile1 }, { cacertfile, CaCertFile1 } ] } ] }</div><div class=""><br class=""></div><div class="">but when I add that directly to the TransportOpts in cowboy:start_tls/3 alongside { port, Port } etc I just get bad_return. There are other options that seem relevant e.g. server_name_indication but I'm finding it tricky to piece it all together to make the right shape of TransportOpts - I'm not clear whether the ssl_opts listed under the <a href="https://ninenines.eu/docs/en/ranch/1.2/manual/ranch_ssl/" class="">ranch_ssl module docs</a> are simply passed through from <a href="http://erlang.org/doc/man/ssl.html" class="">erlang:ssl</a> or whether they're a ranch-specific subset, and either way how to structure the proplist to configure Cowboy to serve multiple TLS names.</div></div></div><div class=""><br class=""></div><div class="">Would very much appreciate any tips or examples!</div><div class=""><br class=""></div><div class="">Thanks,</div><div class="">Igor</div></body></html>