<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div><br class=""><blockquote type="cite" class=""><div class=""><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;" class=""><span style="font-family: -webkit-system-font, Helvetica Neue, Helvetica, sans-serif; color:rgba(127, 127, 127, 1.0);" class=""><b class="">From: </b></span><span style="font-family: -webkit-system-font, Helvetica Neue, Helvetica, sans-serif;" class="">Matt Caswell <<a href="mailto:matt@openssl.org" class="">matt@openssl.org</a>><br class=""></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;" class=""><span style="font-family: -webkit-system-font, Helvetica Neue, Helvetica, sans-serif; color:rgba(127, 127, 127, 1.0);" class=""><b class="">Subject: </b></span><span style="font-family: -webkit-system-font, Helvetica Neue, Helvetica, sans-serif;" class=""><b class="">Re: Using SSL_CTX_set_min_proto_version</b><br class=""></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;" class=""><span style="font-family: -webkit-system-font, Helvetica Neue, Helvetica, sans-serif; color:rgba(127, 127, 127, 1.0);" class=""><b class="">Date: </b></span><span style="font-family: -webkit-system-font, Helvetica Neue, Helvetica, sans-serif;" class="">April 6, 2021 at 2:13:02 PM EDT<br class=""></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;" class=""><span style="font-family: -webkit-system-font, Helvetica Neue, Helvetica, sans-serif; color:rgba(127, 127, 127, 1.0);" class=""><b class="">To: </b></span><span style="font-family: -webkit-system-font, Helvetica Neue, Helvetica, sans-serif;" class=""><a href="mailto:openssl-users@openssl.org" class="">openssl-users@openssl.org</a><br class=""></span></div><br class=""><br class="">On 06/04/2021 18:45, Tamara Kogan via openssl-users wrote:<br class=""><blockquote type="cite" class="">Hello,<br class="">  In our client application we are trying to set TLS 1.2 in ClientHello message. The OpenSSL version is 1.1.1h<br class="">We use the function<br class="">SSL_CTX_set_min_proto_version(ssl->ctx, TLS1_2_VERSION);<br class="">If I test the version right after setting it does return 1.2<br class="">SSL_CTX_get_proto_version(ssl->ctx) == TLS1_2_VERSION<br class="">But the ClientHello is still created with TLS 1.0<br class="">(16 03 01 01 42…)<br class="">Any explanation why the ClientHello message ignores min TLS version?<br class="">Any suggestion how to enforce 1.2 version?<br class=""></blockquote><br class="">You are looking at the *record layer* TLS version. This is always 1.0 in the ClientHello, regardless of what TLS protocol version is actually being requested. TLS protocol version fields are a bit of a minefield of confusion and unexpected behaviour. For example in an OpenSSL TLSv1.3 ClientHello the record layer protocol version will be set to TLSv1.0, the ClientHello message itself will have the protocol version set to TLSv1.2, and the supported versions extension will list the actual supported versions (i.e. in your case it would be  TLSv1.3 and TLSv1.2).<br class=""><br class="">Matt<br class=""><br class=""></div></blockquote></div><br class=""><div class="">I have not found any confirmation in TLS specs that the “record layer” version must be 1.0.</div><div class="">TLS 1.1 <a href="https://tools.ietf.org/html/rfc4346#appendix-A.1" class="">https://tools.ietf.org/html/rfc4346#appendix-A.1</a></div><div class="">TLS 1.2 <a href="https://tools.ietf.org/html/rfc5246#appendix-A.1" class="">https://tools.ietf.org/html/rfc5246#appendix-A.1</a></div><div class="">TLS 1.3  <a href="https://tools.ietf.org/html/rfc8446#appendix-B.1" class="">https://tools.ietf.org/html/rfc8446#appendix-B.1</a></div><div class="">Our client failed to connect to a mail server when the server changed settings and limited  TLS versions to  1.2 only. The server parsed the first three bytes of ClientHello, detected 1.0 version and closed the connection. Then it was a half of a day debugging OpenSSL in attempt to understand why SSL_CTX_set_min_proto_version doesn’t make any difference.</div><div class="">Now the server was updated and it still doesn’t accept ClientHello with 1.0 but at least the server sends “ChangeCipherSpec Message” message and the client resends ClientHello with 1.2.</div><div class="">As a result in order to be connected the client has an extra message exchange.</div><div class="">From my point of view the “Record Layer” ProtocolVersion has to be settable.</div><div class="">Tamara</div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div></body></html>