<div dir="ltr">Hello,<div><br></div><div>Viktor, your help is much appreciated,</div><div><br></div><div>Regarding what you said about the library : </div><div><br></div><div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">The right answer is: don't use this library.</blockquote><br>There are a couple of alternatives for secured websocket clients.  The most popular is boost::beast, based on boost::asio.  But honestly, the interface is so convoluted and hard to use, that this is one of the reasons I picked IXWebSocket instead.  </div><div><br></div><div>I guess that you also tell me to use another library because if this simple thing (checking the ip address) is not well implemented, we cannot trust the rest of the implementation!</div><div><br></div><div>But from there, I`ll try to stick to IXWebSocket a little bit more by: </div><div>1. Fixing the ip address problem with the information you gave me. (Moreover, it helps to understand OpenSSL, it can`t do any harm... I only have 2 months of experience, but I am getting (<i>a little bit</i>) better :)  )</div><div>2. (More a question here).  By monitoring the traffic between client and server using wireshark.  Is it a good idea (and possible), to check the traffic and make sure the data is encrypted?</div><div><br></div><div>About the fix, I realized that IXWebSocket already has : </div><div><br></div><div>            X509_VERIFY_PARAM* param = SSL_get0_param(_ssl_connection);<br>            X509_VERIFY_PARAM_set1_host(param, host.c_str(), host.size());<br></div><div><br></div><div>So, I guess that I should do something like this instead :</div><div><br></div><div>if (isIpAddress(host))</div><div>{</div><div>       //We are connecting to an ip address.  let OpenSSL validate the ip address in SAN</div><div>        SSL_set1_host(_ssl, NULL);</div><div>        X509_VERIFY_PARAM *param = SSL_get0_param(_ssl_connection);</div><div>        X509_VERIFY_PARAM_set1_ip_asc(param, "<ipaddress>");</div><div>}</div><div>else</div><div>{</div><div>            X509_VERIFY_PARAM* param = SSL_get0_param(_ssl_connection);<br>            X509_VERIFY_PARAM_set1_host(param, host.c_str(), host.size());<br></div><div>}</div><div><br></div><div>Does that make sense?</div><div><br></div><div>Thank you very much</div><div><br></div><div>Pierre-Luc</div></div>