Summary
Mattermost desktop app is not able to connect to websocket
Steps to reproduce
Using Mattermost desktop app. Continuous websocket connection error.
Mattermost server is reverse proxied by Nginx Proxy Manager
App is working without errors in browser and on phone app (Websocket connection is established)
Expected behavior
Mattermost app is working properly on multiple platforms, except on desktop app
Observed behavior
App is working without errors in browser and on phone app (Websocket connection is established). During usage of dekstop app, app is not able to recognize that it has SSL.
Broken instance in desktop app
agriesser
(Alexander Griesser)
March 1, 2023, 9:44am
2
Hi @major_malfunction and welcome to the Mattermost forums!
Do you by any chance use a self signed certificate? If so, can you check this issue, please?
opened 10:38AM - 14 Nov 22 UTC
Type/Bug
All Platforms
I confirm (by marking "x" in the [ ] below: [x]):
- [x] This is not a trouble… shooting question. [Troubleshooting questions go here: https://docs.mattermost.com/install/troubleshooting.html](https://docs.mattermost.com/install/troubleshooting.html).
- [x] This doesn't reproduce on web browsers (such as in Chrome). If it does, [issue reports go to the Mattermost Server repository](https://github.com/mattermost/platform/issues).
- [x] I have read [contributing guidelines](https://github.com/mattermost/desktop/blob/master/CONTRIBUTING.md).
---
**Summary**
Custom certificate is not applied to the WebSocket Connection
**Environment**
- Operating System: Ubuntu 22.04
- Mattermost Desktop App version: 5.2.0
- Mattermost Server version: irrelevant
**Steps to reproduce**
- add a custom certificate to /usr/local/share/ca-certificates/...
- run update-ca-certificates
- start Mattermost and set the server address to an HTTPS URL
- accept the "untrusted certificate" in the popup
**Expected behavior**
- Mattermost functioning as usual
**Observed behavior**
- Mattermost starts and messages can be sent, but incoming messages are not shown right away
- after a while, a red banner pops up with the message "server unreachable, check your WebSocket port"
- the .config/Mattermost/certificate.json file contains the custom certificate, but only for the `https://...` address
- the log contains the message `[warn] Ignoring certificate for unmatched origin wss://..., will not trust`
<!--
Please include relevant error messages and/or screenshots.
-->
**Possible fixes**
Manually copying the `https://` section for `wss://` as follows seems to fix the problem:
```
{
"https://...": {
"data": "-----BEGIN CERTIFICATE-----...-----END CERTIFICATE-----\n",
"issuerName": "...",
"dontTrust": false
},
"wss://...": {
"data": "-----BEGIN CERTIFICATE-----...-----END CERTIFICATE-----\n",
"issuerName": "...",
"dontTrust": false
}
}
```
<!--
If you can, link to the line of code that might be responsible for the problem.
-->
If you’re using an official certificate and if your server is publicly reachable, please try to validate the certificate chain with Qualys SSLLabs Analyzer to rule out any obvious problems with the certificate chain.
If it’s still not working, please have a look at the logs of your desktop application and post the relevant logs here for further examination.
1 Like
Thank you for welcome @agriesser
I’m using Let’s Encrypt SSL on my Mattermost host. I have made the checks that are recommended and Qualys gives the Grade A for my SSL.
Logs on Desktop APP are reporting this:
Preload initialized
products.ts:63 Feature flag for product boards not enabled. Not loading it.
websocket.js:62 websocket connecting to wss://im.lumenspei.com/api/v4/websocket
VM5:417 registering Mattermost v5.2.2 with the server
websocket.js:112 websocket error
websocket.js:113 Event
websocket.js:90 websocket closed
websocket.js:112 websocket error
websocket.js:113 Event
43team_controller.tsx:65 computer woke up - fetching latest
websocket.js:67 WebSocket connection to ‘wss://im.lumenspei.com/api/v4/websocket?connection_id=&sequence_number=0’ failed:
initialize @ websocket.js:67
websocket.js:67 WebSocket connection to ‘wss://im.lumenspei.com/api/v4/websocket?connection_id=&sequence_number=0’ failed:
initialize @ websocket.js:67
websocket.js:67 WebSocket connection to ‘wss://im.lumenspei.com/api/v4/websocket?connection_id=&sequence_number=0’ failed:
initialize @ websocket.js:67
websocket.js:67 WebSocket connection to ‘wss://im.lumenspei.com/api/v4/websocket?connection_id=&sequence_number=0’ failed:
initialize @ websocket.js:67
websocket.js:67 WebSocket connection to ‘wss://im.lumenspei.com/api/v4/websocket?connection_id=&sequence_number=0’ failed:
initialize @ websocket.js:67
websocket.js:67 WebSocket connection to ‘wss://im.lumenspei.com/api/v4/websocket?connection_id=&sequence_number=0’ failed: