<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.MsoPlainText, li.MsoPlainText, div.MsoPlainText
        {mso-style-priority:99;
        mso-style-link:"Plain Text Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
span.PlainTextChar
        {mso-style-name:"Plain Text Char";
        mso-style-priority:99;
        mso-style-link:"Plain Text";
        font-family:"Calibri","sans-serif";}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-GB" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoPlainText">Hi Manuel,<o:p></o:p></p>
<p class="MsoPlainText">If there is a websocket handshake error / incorrect port etc, then you will send an HTTP error and close the connection (otherwise non-websocket connections could use up resources).<o:p></o:p></p>
<p class="MsoPlainText">If the handshake is successful, then the connection is upgraded and no HTTP final response is ever sent, hence the connection is not closed. Our implementation is working fine with this line in there.<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">The log excerpt you gave on Monday shows two connections. The second was for a normal browser GET, not a websocket, so it finds the end-of-header marker instead of the Upgrade header and closes the connection.<o:p></o:p></p>
<p class="MsoPlainText">The first connection doesn’t look like it even gets as far as the event route before it is disconnected. I suspect a TLS handshake failure.<o:p></o:p></p>
<p class="MsoPlainText">Can you look at a network trace of the connection? Wireshark will show if there is a certificate failure and which side sent it.<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">Regards,<o:p></o:p></p>
<p class="MsoPlainText">Hugh<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText"><span lang="EN-US" style="mso-fareast-language:EN-GB">-----Original Message-----<br>
From: sr-users-bounces@lists.sip-router.org [mailto:sr-users-bounces@lists.sip-router.org] On Behalf Of Daniel-Constantin Mierla<br>
Sent: 10 September 2014 18:00<br>
To: Juha Heinanen; Kamailio (SER) - Users Mailing List<br>
Cc: Manuel Camarg<br>
Subject: Re: [SR-Users] TLS Handshake failing with WSS</span></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">On 10/09/14 18:43, Juha Heinanen wrote:<o:p></o:p></p>
<p class="MsoPlainText">> Daniel-Constantin Mierla writes:<o:p></o:p></p>
<p class="MsoPlainText">><o:p> </o:p></p>
<p class="MsoPlainText">>> The set_reply_close() should be removed from there.<o:p></o:p></p>
<p class="MsoPlainText">> why is that? my wss clients<o:p></o:p></p>
<p class="MsoPlainText">are they ws (over tcp) or wss (over tls)?<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">>   work fine even when i have:<o:p></o:p></p>
<p class="MsoPlainText">><o:p> </o:p></p>
<p class="MsoPlainText">> event_route[xhttp:request] {  # Handle HTTP requests<o:p></o:p></p>
<p class="MsoPlainText">><o:p> </o:p></p>
<p class="MsoPlainText">>             set_reply_close();<o:p></o:p></p>
<p class="MsoPlainText">>             set_reply_no_connect();<o:p></o:p></p>
<p class="MsoPlainText">><o:p> </o:p></p>
<p class="MsoPlainText">> this was included in the original instructions when wss transport was
<o:p></o:p></p>
<p class="MsoPlainText">> introduced to kamailio.<o:p></o:p></p>
<p class="MsoPlainText">I guess the example was built on top of the one for xhttp module which closes the connection after sending the http reply.<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">On the other hand, I remember that I tested with default example some time ago and worked. However, more recent versions of browsers don't work with that anymore. What browser (or wss client) are you using?<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">Cheers,<o:p></o:p></p>
<p class="MsoPlainText">Daniel<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">--<o:p></o:p></p>
<p class="MsoPlainText">Daniel-Constantin Mierla<o:p></o:p></p>
<p class="MsoPlainText"><a href="http://twitter.com/#!/miconda"><span style="color:windowtext;text-decoration:none">http://twitter.com/#!/miconda</span></a> -
<a href="http://www.linkedin.com/in/miconda"><span style="color:windowtext;text-decoration:none">http://www.linkedin.com/in/miconda</span></a><o:p></o:p></p>
<p class="MsoPlainText">Next Kamailio Advanced Trainings 2014 - <a href="http://www.asipto.com">
<span style="color:windowtext;text-decoration:none">http://www.asipto.com</span></a> Sep 22-25, Berlin, Germany<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">_______________________________________________<o:p></o:p></p>
<p class="MsoPlainText">SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list<o:p></o:p></p>
<p class="MsoPlainText"><a href="mailto:sr-users@lists.sip-router.org"><span style="color:windowtext;text-decoration:none">sr-users@lists.sip-router.org</span></a><o:p></o:p></p>
<p class="MsoPlainText"><a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users"><span style="color:windowtext;text-decoration:none">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</span></a><o:p></o:p></p>
</div>
<hr>
<p class="MsoNormal"><span style="font-size:7.5pt;line-height:115%;font-family:
"Arial","sans-serif";mso-fareast-font-family:"Times New Roman";color:gray">This e-mail and any attachment
<span class="GramE">is</span> for <span class="SpellE">authorised</span> use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained
 or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you for understanding.</span></p>
</body>
</html>