<div dir="ltr"><div><div><div><div><div><div><div><div><div>I just tried s_server, and its logs included something like "Hostname in TLS extension".<br></div><br></div>But I still have a couple of puzzles.<br></div>1. Why does s_server need option "-servername"?<br></div>I supposed only s_client needs this option.<br></div>With my test, if only s_client specified "-servername server", the desired certificate still was not used.<br></div>My commands like:<br></div>Server side: openssl s_server -cert cert1 -key key1 -cert2 cert2 -key2 key2 -www -accept 4433<br></div>Client side: openssl s_client -connect localhost:4433 -servername <a href="http://www.server2.com">www.server2.com</a> < /dev/null<br></div>Here, if <a href="http://www.server2.com">www.server2.com</a> is selected, (I hoped) cert2/key2 is used. But it didn't happen with the above case.<br><div><br><div><div><div><div>2. It looks options -servername and -alpn cannot work together.</div><div>Please consider the following case,<br></div><div>Server side: openssl s_server -cert cert1 -key key1 -cert2 cert2 -key2 key2 -servername <a href="http://www.server2.com">www.server2.com</a> -alpn h2 -www -accept 4433<br>Client side: openssl s_client -connect localhost:4433 -servername <a href="http://www.server2.com">www.server2.com</a>  -alpn h2 < /dev/null</div><div>With the above commands, s_client outputted "No ALPN negotiated", and cert2 was selected.<br></div><div>But removed "-servername <a href="http://www.server2.com">www.server2.com</a>" from server side, and re-run client side command, it outputted "ALPN protocol: h2", but cert1 was selected (namely, SNI didn't work).<br></div><div><br></div><div>Thanks!<br></div></div></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">2017-11-27 12:27 GMT+08:00 Kyle Hamilton <span dir="ltr"><<a href="mailto:aerowolf@gmail.com" target="_blank">aerowolf@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto">The -servername [host] is what causes the SNI extension to be sent.  I don't think its sending is put into the debug output. Do you really need it there?<div dir="auto"><br></div><div dir="auto">I'm pretty certain that s_server outputs it in debug output.</div><div dir="auto"><br></div><div dir="auto">-Kyle H</div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">On Nov 26, 2017 18:59, "John Jiang" <<a href="mailto:john.sha.jiang@gmail.com" target="_blank">john.sha.jiang@gmail.com</a>> wrote:<br type="attribution"></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div dir="ltr"><div>Hi,<br>The following is my OpenSSL version info,<br>OpenSSL 1.1.0f  25 May 2017<br><br></div>I supposed the below command can give me some SNI info, but nothing was found.<br>openssl s_client -debug -tlsextdebug -msg -connect <host:port> -servername <server> < /dev/null | grep "server name"<br><div>But I found SNI extension with Wireshark while running the above command.<br></div><div><br></div><div>Is it possible get SNI info with s_client?</div><div>Thanks!<br></div></div>
<br></div></div><span class="HOEnZb"><font color="#888888">--<br>
openssl-users mailing list<br>
To unsubscribe: <a href="https://mta.openssl.org/mailman/listinfo/openssl-users" rel="noreferrer" target="_blank">https://mta.openssl.org/mailma<wbr>n/listinfo/openssl-users</a><br>
<br></font></span></blockquote></div></div>
<br>--<br>
openssl-users mailing list<br>
To unsubscribe: <a href="https://mta.openssl.org/mailman/listinfo/openssl-users" rel="noreferrer" target="_blank">https://mta.openssl.org/<wbr>mailman/listinfo/openssl-users</a><br>
<br></blockquote></div><br></div>