<html><head></head><body><div style="color:#000; background-color:#fff; font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:16px"><div id="yiv4036341116"><div id="yui_3_16_0_ym18_1_1459664989656_215702"><div style="color:#000;background-color:#fff;font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:16px;" id="yui_3_16_0_ym18_1_1459664989656_215701"><div dir="ltr" id="yiv4036341116yui_3_16_0_ym18_1_1459664989656_201958"><span id="yiv4036341116yui_3_16_0_ym18_1_1459664989656_201983">I have a client application that works with non-blocking BIO. The handshake loop looks, very roughly, like this:</span></div><div dir="ltr" id="yiv4036341116yui_3_16_0_ym18_1_1459664989656_201958"><span><br clear="none"></span></div><div dir="ltr" id="yiv4036341116yui_3_16_0_ym18_1_1459664989656_201958"><span>  1. call </span>SSL_connect()</div><div dir="ltr" id="yiv4036341116yui_3_16_0_ym18_1_1459664989656_201958">  2. if the return value is -1 and SSL_get_error() returns WANT_READ or WANT_WRITE, perform the relevant select() call</div><div dir="ltr" id="yiv4036341116yui_3_16_0_ym18_1_1459664989656_201958">  3. go to 1 and repeat until SSL_connect() returns 1</div><div dir="ltr" id="yiv4036341116yui_3_16_0_ym18_1_1459664989656_201958"><br clear="none"></div><div dir="ltr" id="yiv4036341116yui_3_16_0_ym18_1_1459664989656_201958"><span id="yiv4036341116yui_3_16_0_ym18_1_1459664989656_203869">Let's say, I want to add an option of breaking this loop early due to some external cause, e.g. - the client </span>application is closing. In this case, I'd like to let the server know that my client is exiting and will not be finishing the handshake process. What would be the proper API call to indicate this to the server? SSL_shutdown is not an option.</div><div dir="ltr" id="yiv4036341116yui_3_16_0_ym18_1_1459664989656_201958"><br clear="none"></div><div dir="ltr" id="yiv4036341116yui_3_16_0_ym18_1_1459664989656_201958">For TLS over TCP, closing the underlying TCP socket would probably do the trick, but in the case of DTLS over UDP (or other connection-less protocols) it would be better if the server received an alert message. If the DTLS client just exits silently in the middle of the handshake, the server will perform a series of timeouts/retransmissions as required by the DTLS standard, which can potentially take up to several minutes. This is why I am looking for an OpenSSL API call that could be used in the middle of handshake and would result in an alert message.</div><div dir="ltr" id="yiv4036341116yui_3_16_0_ym18_1_1459664989656_201958"><br clear="none"></div><div dir="ltr" id="yiv4036341116yui_3_16_0_ym18_1_1459664989656_201958">Hope this was more clear.</div><div id="yiv4036341116yui_3_16_0_ym18_1_1459664989656_201958"><br clear="none"></div> <div class="yiv4036341116qtdSeparateBR" id="yiv4036341116yui_3_16_0_ym18_1_1459664989656_201957"><br clear="none"><br clear="none"></div><div class="yiv4036341116yqt6068789498" id="yiv4036341116yqt82739"></div></div></div></div><div class=".yiv4036341116yahoo_quoted"> <div id="yiv4036341116yui_3_16_0_ym18_1_1459664989656_201934" style="font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:16px;"> <div id="yiv4036341116yui_3_16_0_ym18_1_1459664989656_201933" style="font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:16px;"> <div dir="ltr" id="yiv4036341116yui_3_16_0_ym18_1_1459664989656_201955"><font id="yiv4036341116yui_3_16_0_ym18_1_1459664989656_201954" size="2" face="Arial"> On Sunday, April 3, 2016 11:17 AM, Otis Evans <otisevans98@gmail.com> wrote:<br clear="none"></font></div>  <br clear="none"><br clear="none"> <div class="yiv4036341116y_msg_container" id="yiv4036341116yui_3_16_0_ym18_1_1459664989656_201932"><div id="yiv4036341116"><div id="yiv4036341116yui_3_16_0_ym18_1_1459664989656_201931"><div dir="ltr" id="yiv4036341116yui_3_16_0_ym18_1_1459664989656_201944">Explain more</div>
<div class="yiv4036341116gmail_quote" id="yiv4036341116yui_3_16_0_ym18_1_1459664989656_201930">On Apr 3, 2016 2:59 AM, "Michael Kravchenko" <<a rel="nofollow" shape="rect" id="yiv4036341116yui_3_16_0_ym18_1_1459664989656_206579" ymailto="mailto:mkrav@yahoo-inc.com" target="_blank" href="mailto:mkrav@yahoo-inc.com">mkrav@yahoo-inc.com</a>> wrote:<br clear="none"><blockquote class="yiv4036341116gmail_quote" id="yiv4036341116yui_3_16_0_ym18_1_1459664989656_203778" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="yiv4036341116yqt4140313539" id="yiv4036341116yqt10121"><div id="yiv4036341116yui_3_16_0_ym18_1_1459664989656_203777"><div id="yiv4036341116yui_3_16_0_ym18_1_1459664989656_203776" style="color:#000;background-color:#fff;font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:16px;"><div dir="ltr" id="yiv4036341116yui_3_16_0_ym18_1_1459664989656_203775"><span style="color:rgb(34,34,34);font-family:Arial, Helvetica, sans-serif;font-size:13px;line-height:normal;">Hi, </span><br clear="none" style="color:rgb(34,34,34);font-family:Arial, Helvetica, sans-serif;font-size:13px;line-height:normal;"><br clear="none" style="color:rgb(34,34,34);font-family:Arial, Helvetica, sans-serif;font-size:13px;line-height:normal;"><span id="yiv4036341116yui_3_16_0_ym18_1_1459664989656_206352" style="color:rgb(34,34,34);font-family:Arial, Helvetica, sans-serif;font-size:13px;line-height:normal;">(My question is regarding a problem I discovered while developing a DTLS client, but I'm not sure that it's specific to DTLS) </span><br clear="none" style="color:rgb(34,34,34);font-family:Arial, Helvetica, sans-serif;font-size:13px;line-height:normal;"><br clear="none" style="color:rgb(34,34,34);font-family:Arial, Helvetica, sans-serif;font-size:13px;line-height:normal;"><span id="yiv4036341116yui_3_16_0_ym18_1_1459664989656_206331" style="color:rgb(34,34,34);font-family:Arial, Helvetica, sans-serif;font-size:13px;line-height:normal;">What is the proper way to cancel a handshake process in the middle? I have a client working with non-blocking BIO, which performs a series of SSL_connect() calls to establish connection to the server. Let's say that during the handshake process, the client, for some reason, decides to abort it. Ideally, I'd like the server to receive an alert message indicating that the client will not be finishing the handshake. </span><br clear="none" style="color:rgb(34,34,34);font-family:Arial, Helvetica, sans-serif;font-size:13px;line-height:normal;"><br clear="none" style="color:rgb(34,34,34);font-family:Arial, Helvetica, sans-serif;font-size:13px;line-height:normal;"><span style="color:rgb(34,34,34);font-family:Arial, Helvetica, sans-serif;font-size:13px;line-height:normal;">SSL_shutdown() cannot be used here, since it works only after the handshake. </span><br clear="none" style="color:rgb(34,34,34);font-family:Arial, Helvetica, sans-serif;font-size:13px;line-height:normal;"><br clear="none" style="color:rgb(34,34,34);font-family:Arial, Helvetica, sans-serif;font-size:13px;line-height:normal;"><span style="color:rgb(34,34,34);font-family:Arial, Helvetica, sans-serif;font-size:13px;line-height:normal;">I cannot find any public API call that could be used in this situation. ssl3_send_alert() is not a public API call. </span><br clear="none" style="color:rgb(34,34,34);font-family:Arial, Helvetica, sans-serif;font-size:13px;line-height:normal;"><br clear="none" style="color:rgb(34,34,34);font-family:Arial, Helvetica, sans-serif;font-size:13px;line-height:normal;"><span style="color:rgb(34,34,34);font-family:Arial, Helvetica, sans-serif;font-size:13px;line-height:normal;">Any ideas on what would be the best way to proceed in this situation? </span><br clear="none" style="color:rgb(34,34,34);font-family:Arial, Helvetica, sans-serif;font-size:13px;line-height:normal;"><br clear="none" style="color:rgb(34,34,34);font-family:Arial, Helvetica, sans-serif;font-size:13px;line-height:normal;"><span style="color:rgb(34,34,34);font-family:Arial, Helvetica, sans-serif;font-size:13px;line-height:normal;">Thanks </span><br clear="none"></div></div></div></div><br clear="none">--<br clear="none">
openssl-users mailing list<br clear="none">
To unsubscribe: <a rel="nofollow" shape="rect" target="_blank" href="https://mta.openssl.org/mailman/listinfo/openssl-users">https://mta.openssl.org/mailman/listinfo/openssl-users</a><br clear="none">
<br clear="none"></blockquote></div></div></div><br clear="none"><br clear="none"></div>  </div> </div>  </div></div></body></html>