title: wss connection failed: Error in connection establishment: net::ERR_CERT_COMMON_NAME_INVALID
body: <p>I've build up a working FreeSwitch box and can make internal calls on desktops using ws connections. Later on, I've configured the box to use SSL with certificates issued by Letsencrypt. SSL certificates are validated all good by <a href="https://www.sslshopper.com/ssl-checker.htm" rel="nofollow noreferrer">https://www.sslshopper.com/ssl-checker.htm</a>, and https:// connection in Chrome shows a good lock sign.</p>
  
  <p>Then I changed my code from ws to wss (see below; the public IP address is masked.), but got 'net::ERR_CERT_COMMON_NAME_INVALID' errors in Chrome.</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
      &lt;meta charset="UTF-8"&gt;
      &lt;title&gt;sipjs-webphone&lt;/title&gt;
      &lt;script src="./sip-0.15.1.min.js"&gt;&lt;/script&gt;
      &lt;script&gt;
  
      var config = {  uri: '1000@1xx.xxx.xxx.xxx', 
      transportOptions: { wsServers: ['wss://1xx.xxx.xxx.xxx:7443'] }, 
      authorizationUser: '1000', password: '1234' };
  
      var ua = new SIP.UA(config);
  
      ua.on("connected", function() {
          console.log("Connected!");
      });
      &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Btw, I tried to change to following 2 places already:</p>
  
  <p>1) append or replace /etc/freeswitch/tls/wss.pem with the valid certs/keys from Letsencrypt, no joy.</p>
  
  <pre><code>echo '' &gt;&gt; /usr/local/freeswitch/certs/wss.pem &amp;&amp; cat cert.pem &gt;&gt; /usr/local/freeswitch/certs/wss.pem &amp;&amp; cat privkey.pem &gt;&gt; /usr/local/freeswitch/certs/wss.pem &amp;&amp; cat chain.pem &gt;&gt; /usr/local/freeswitch/certs/wss.pem
  </code></pre>
  
  <p>2) created wss.pem in /usr/local/freeswitch/certs (this directory was not existing if installed by 'apt install freeswitch', rather than from compiling the source code), but still no joy.</p>