WSS over Secure SSL connection fails only on FireFox with error 1006

Madhuram Swaminathan

My website runs on https/ssl (valid CA certificate) on IIS 10.0 (iisnode 0.2.21) / node/express. I am using a websocket server on top of https server (same port)

However the websocket connection works very well for CHrome and IE11. It fails only for Firefox (version 80) with error code 1006 (error details)

in Inspector / Network console, it gives the following errorerror as shown in network under inspector console

In the web.config file, I have added the following line <webSocket enabled="false"/>

app.js code is as below:

var cors = require('cors');
var createError = require('http-errors');
var cookieParser = require('cookie-parser');
const https = require("https");
// var app = express();
var app = require('express-ws-routes')();

.....

var wsRouter = require("./routes/wsRoute"); // route for Websocket

....
app.use('/ws', wsRouter);

....
app.listen(process.env.PORT || 443);

In my Websocket route, I use the following code

router.websocket('/', function(info, cb,  next) {
    
    var connid = info.req.query.connid;
    var pgid = info.req.query.pageid;

    cb(function(socket) {   
        // socket is connected   
        socket.send(JSON.stringify({'response_type':'WSConnActive',
                            'response':{"status":"success","details":"Welcome Message","reqOrigin":"Home","welcomeMsg":'Hello '+usr+', Welcome! you are now connected!'}}));

....
 socket.on('message', function incoming(message) {  // handle message }

socket.on("close", function socketClose(ws){
            console.log(info.req.query.usr+" closed session at "+moment().format("YYYY-MM-DD HH:mm:ss"));
            var usrClose = info.req.query.usr;
...}
});  });

At the client end I connect var socket = new WebSocket('wss://<host>:443/ws?request_type=init&usr='+UserID+'&connid='+connectTime+'&pageid='+page_ID);

All this works as expected for Chrome and IE11 except firefox

I am not sure where the issue is.. any help is appreciated!

Madhuram Swaminathan

Finally got the WSS working on Firefox with help of the note found in iisnode githun ([https://github.com/tjanczuk/iisnode/issues/497][1]) !. Issue seemed to be with iisnode configuration, In addition t , i had create a HTTP_CONNECTION server variable and add rewrite rules as below,

                  <match url="ws/*" />      
                  <serverVariables>
                      <set name="HTTP_CONNECTION" value="Upgrade" />
                  </serverVariables>                    
                  <action type="Rewrite" url="websocket-server.js" />
            </rule> ```




  [1]: https://github.com/tjanczuk/iisnode/issues/497

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

SQL Server JDBC Error on Java 8: The driver could not establish a secure connection to SQL Server by using Secure Sockets Layer (SSL) encryption

iOS 9.3 : An SSL error has occurred and a secure connection to the server cannot be made

iOS9 getting error “an SSL error has occurred and a secure connection to the server cannot be made”

SSL socket connection over Java

“an ssl error has occurred and a secure connection to the server cannot be made” connecting to Internal Development Server on phone only

An SSL error has occurred and a secure connection to the server cannot be made only on ios

SSL error : Secure Connection Failed

MySQL connection over SSL with Laravel

Is SSL secure connection available without browser call?

Free Heroku site can't provide a secure connection: ERR_SSL_PROTOCOL_ERROR

System.Net.WebException: An SSL error has occurred and a secure connection to the server cannot be made

SQL Server JDBC Error: The driver could not establish a secure connection to SQL Server by using Secure Sockets Layer (SSL) encryption

Error: SSL Misconfiguration (Your connection to this site is not secure)

Minimum secure message size over SSL

ECM Error: The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel

Why does my wss:// (WebSockets over SSL/TLS) connection immediately disconnect without giving any errors?

xcode - Bot creation failed with error: An SSL error has occurred and a secure connection to the server cannot be made

set up secure connection over SSH

OpenVPN website secure connection Error

MongoDb and nodejs SSl/Secure Connection

s_client connection to server fails with ssl error code 47

Firefox: Secure Connection Failed SSL_ERROR_BAD_MAC_ALERT

Firefox "this connection is not secure" for login form

How to work around this `Your connection is not secure` error in Firefox when using mitmweb?

Website shows 'connection is not secure' on Firefox

This site can’t provide a secure connection – ERR_SSL_PROTOCOL_ERROR

WebRTC server (mediasoup) throws SSL error, but only for Firefox (?!)

GitLab - Secure Connection Failed error on firefox

blazor mqttnet connection fails due to ws vs wss

TOP Ranking

HotTag

Archive