title: Security issues with three browsers (Chrome, Edge, Firefox) and websockets using autobahn
body: <p>I am using an autobahn server from this example: <a href="https://github.com/crossbario/autobahn-python/tree/master/examples/twisted/websocket/echo_tls" rel="nofollow noreferrer">https://github.com/crossbario/autobahn-python/tree/master/examples/twisted/websocket/echo_tls</a></p>
  
  <p>and following the mentioned in the example instructions, I generated the server keys:</p>
  
  <pre><code>openssl genrsa -out server.key 2048
  openssl req -new -key server.key -out server.csr
  openssl x509 -req -days 3650 -in server.csr -signkey server.key -out server.crt
  openssl x509 -in server.crt -out server.pem
  </code></pre>
  
  <p>I also have an autobahn-js client:</p>
  
  <pre><code>&lt;html&gt;
      &lt;head&gt;
          &lt;script src="autobahn.min.js"&gt;&lt;/script&gt;
          &lt;script&gt;
              var connection = new autobahn.Connection({url: 'wss://domain.com'});
  
  connection.onopen = function (session) {
  
     // 1) subscribe to a topic
     function onevent(args) {
        console.log("Event:", args[0]);
     }
     session.subscribe('com.myapp.hello', onevent);
  
     // 2) publish an event
     session.publish('com.myapp.hello', ['Hello, world!']);
  
     // 3) register a procedure for remoting
     function add2(args) {
        return args[0] + args[1];
     }
     session.register('com.myapp.add2', add2);
  
     // 4) call a remote procedure
     session.call('com.myapp.add2', [2, 3]).then(
        function (res) {
           console.log("Result:", res);
        }
     );
  };
  
  connection.open();
  &lt;/script&gt;
      &lt;/head&gt;
      &lt;body&gt;&lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>However, running the above js-code in three popular browsers (Chrome, Edge, Firefox), revealed security issues in the connection which I am pasting here using each browser's console.</p>
  
  <p><strong>Google Chrome</strong>:</p>
  
  <pre><code>WebSocket connection to 'wss://domain/' failed: Error in connection establishment: net::ERR_INSECURE_RESPONSE
  (anonymous) @   autobahn.min.js:196
  </code></pre>
  
  <p><strong>Microsoft Edge</strong>:</p>
  
  <pre><code>SCRIPT12045: WebSocket Error: Network Error 12045, The certificate authority is invalid or incorrect
  </code></pre>
  
  <p><strong>Mozilla Firefox</strong>:</p>
  
  <p>On Firefox's case it's the server that complains about the client's ca with the following message:</p>
  
  <pre><code>2017-11-15T09:04:38+0000 Connection to/from tcp4:&lt;ip here&gt; lost (&lt;class 'OpenSSL.SSL.Error'&gt;): [('SSL routines', 'ssl3_read_bytes', 'tlsv1 alert unknown ca')])
  2017-11-15T09:04:38+0000 _connectionLost: [Failure instance: Traceback: &lt;class 'OpenSSL.SSL.Error'&gt;: [('SSL routines', 'ssl3_read_bytes', 'tlsv1 alert unknown ca')]
  </code></pre>
  
  <p>Are the keys generated with the "openssl" tool not good enough for browsers? How can I solve this problem? Why is Firefox not complaining about the server's security?</p>