question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[WSS] WebSocket connection failed: Error in connection establishment: net::ERR_CERT_AUTHORITY_INVALID

See original GitHub issue
const Const = require('../const')
const File = require('fs')

module.exports = () => {
    const options = {};
    if(Const.SSL_OPTIONS.isPFX == true) {
        options.pfx = File.readFileSync(Const.SSL_OPTIONS.PFX);
        options.passphrase = Const.SSL_OPTIONS.PFXPass;
    } else {
        options.key = File.readFileSync(Const.SSL_OPTIONS.PRIVKEY);
        options.cert = File.readFileSync(Const.SSL_OPTIONS.CERT);
        if(Const.SSL_OPTIONS.isCA == true) {
            options.ca = File.readFileSync(Const.SSL_OPTIONS.CA);
        }
    }
    return options;
}

▲ secure.js / webinit.js ▼

const options = Secure();
HTTPS_Server = https.createServer(options)
	.listen(global.test ? (Const.TEST_PORT + 416) : process.env['KKUTU_PORT']);
Server = new WebSocket.Server({server: HTTPS_Server});

When I tried to connect websocket, it raises ERR_CERT_AUTHORITY_INVALID

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8

github_iconTop GitHub Comments

6reactions
soulbeingcommented, Jun 25, 2018

@ibc Can you provide some examples of what you meant by additional stuff? There’s not much documents around, can you provide more details, please?

0reactions
Harpreetsinghbedicommented, Jun 8, 2020

Hi, I have fixed this issue via using CA certificate.

I get my host certificate and install it with my computer to fix it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Failed: Error in connection establishment: net ... - Stack Overflow
Firstly, I would try a non-secure websocket connection. So remove one of the s 's from the connection address:
Read more >
Error with WebSocket - Microsoft Q&A
Hello I get the error: WebSocket connection to 'wss://localhost:54970/Dashboard.Server/' failed: Error in connection establishment: net:: ...
Read more >
Websocket connection failed: Error in connection establishment
I am working on video conferencing with mediasoup demo but i am getting this error: WebSocket connection to 'wss://videocall.test.com:4443/?
Read more >
[SOLVED] WebSocket Connection Error - smartfoxserver.com
WebSocket connection to 'wss://myip/websocket' failed: Error in connection establishment: net::ERR_CERT_AUTHORITY_INVALID.
Read more >
WebSocket connection to 'ws://localhost:8000/' failed: Error in ...
Hello everyone! I'm having some problems using WebSocket WS in my application. After many tests on my localhost, where everything works ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found