<html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">Hi,<br>
<br>
On 31/01/22 10:27, Srinivas, Saketh (c) wrote:<br>
</div>
<blockquote type="cite"
cite="mid:DM8PR03MB62612F1286EA490879F7C1F4D1259@DM8PR03MB6261.namprd03.prod.outlook.com">
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif;
font-size: 12pt; color: rgb(0, 0, 0);">
Hi,</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif;
font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif;
font-size: 12pt; color: rgb(0, 0, 0);">
what is the difference between SSL_CTX_set_min_proto_version
and SSL_set_min_proto_version.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif;
font-size: 12pt; color: rgb(0, 0, 0);">
How will they effect the SSL handsahke.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif;
font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif;
font-size: 12pt; color: rgb(0, 0, 0);">
I can see two versions numbers in the PCAP files, </div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif;
font-size: 12pt; color: rgb(0, 0, 0);">
<ol>
<li><span>content type is handshake , version v1.0</span></li>
<li><span>handshake type client hello, version v1.2</span></li>
</ol>
<div>what is the difference and how to modify them.</div>
<div><br>
</div>
<br>
</div>
</blockquote>
<br>
The effect of SSL_CTX_set_min_proto_version and
SSL_set_min_proto_version is exactly the same - it sets the minimum
TLS/SSL proto version to be used during the client/server handshake
(exchange of "hello" messages).<br>
<br>
The TLS/SSL version mentioned during "content type = handshake" is
known as the record layer version number. If you read the TLS 1.2
spec (<a class="moz-txt-link-freetext" href="https://datatracker.ietf.org/doc/html/rfc5246">https://datatracker.ietf.org/doc/html/rfc5246</a>) you will find<br>
" Earlier versions of the TLS specification were not fully clear on<br>
what the record layer version number (TLSPlaintext.version)
should<br>
contain when sending ClientHello (i.e., before it is known which<br>
version of the protocol will be employed). Thus, TLS servers<br>
compliant with this specification MUST accept any value {03,XX}
as<br>
the record layer version number for ClientHello.<br>
"<br>
<br>
Check out this snippet of code (line numbers are from openssl
1.1.1k, file "ssl/record/rec_layer_s3.c"):<br>
<br>
849 /*<br>
850 * Some servers hang if initial client hello is larger
than 256 bytes<br>
851 * and record version number > TLS 1.0<br>
852 */<br>
853 if (SSL_get_state(s) == TLS_ST_CW_CLNT_HELLO<br>
854 && !s->renegotiate<br>
855 && TLS1_get_version(s) >
TLS1_VERSION<br>
856 && s->hello_retry_request ==
SSL_HRR_NONE)<br>
857 version = TLS1_VERSION;<br>
858 SSL3_RECORD_set_rec_version(thiswr, version);<br>
<br>
which shows that OpenSSL explicitly sets the *record* version number
to TLS 1.0 ; one could argue whether such buggy servers still exist
and whether there should be an option to overrule the above
behaviour. <br>
<br>
Thus, this is not affected by any calls to
SSL_CTX_set_min_proto_version or SSL_set_min_proto_version. <br>
However, the above is safe in terms of "it works with buggy servers"
as well as safe in terms of "the connection *will* use tls 1.2+ if I
call SSL_{ctx_}set_min_proto_version" so why change?<br>
<br>
Hope this clarifies things,<br>
<br>
JJK / Jan Just Keijser<br>
<br>
</body>
</html>