[Bug]: Invalid SSL cert pops warning every minute, encouraging unsafe choice
- Dominant language
- C++
- Stars
- 3.9k
- Forks
- 1k
- Avg merge
- 1d 21h
- Merged PRs (30d)
- 127
Description
### ⚠️ Before submitting, please verify the following: ⚠️
- [X] This is a **bug**, not a question or a configuration issue.
- [X] This issue is **not** already reported on Github (I've searched it).
- [X] Nextcloud Server and Desktop Client are **up to date**. See [Server Maintenance and Release Schedule](https://github.com/nextcloud/server/wiki/Maintenance-and-Release-Schedule) and [Desktop Releases](https://nextcloud.com/install/#install-clients) for supported versions.
- [X] I agree to follow Nextcloud's [Code of Conduct](https://nextcloud.com/contribute/code-of-conduct/)
### Bug description
Hello,
I was a bit torn on whether to post here on the form, but I think this matter deserves to be discussed among developers and should ultimately result in a change to code. I also know that the root cause for my problem is not necessarily the Nextcloud client itself. But I think we can make a small change that will make NC more secure for everyone, so please hear me out. :)
My Situation is as follows:
I have my client connected to multiple NC servers, a few private ones and a few for work. This seems to be a common use-case among a lot of people that I know. It so happens that one of the server I am connected to for reasons of work has administrators that occasionally let a the SSL certificate expire. Of course that always happens when they are on vacation for the next few days and no one else can address it. ;) This causes an "invalid certificate" warning to be raised by the nextcloud client **every minute**.
I have tried to "pause sync" for that server. and it appears that I was already "signed out" from it automatically, but still: The warning shows up every minute. After trying around for a bit, I have concluded that the only ways I can "make the warning go away" are:
- quitting the nextcloud client entirely - which cuts me off from my private servers
- completely disconnect the offending server from my client - which means I have to set it up later again.
Both are a major nuisance...
Now I personally, am a security-professional, so I naturally opt for the more secure options, even if its annoying. But talking to my coworkers, I discovered that a lot of them will just tick `[ ] Trust this certificate anyway` to get on with their lives. I know its kinda sad but lets be honest, that's how people work. :shrug:
Of course, on one hand that is "their problem" now, but in another way it is like the NC Client is almost nudging them towards this course of action with the annoying repeated prompt. Which leads me to my proposal, see "Expected behavior".
### Steps to reproduce
1. Add a nextcloud server with an expired ssl certificate to your client
2. Get spammed with pop-up notifications...
### Expected behavior
Since expired certificates are a rather common problem, I think NC Client should handle the interaction with the user more "constructively". I.e.: Not nudging the user into making an insecure choice ("Trust this cert anyway").
The easiest fix would be to reduce the frequency with which this warning pops up.
An even better way might be offering the user a better explanation of what is happening, what he can/should do and clearly mark the consequences of each, something like:
-------
Cannot connect securely to ``:
``
``
You should contact the adminstrator of your server to get this problem fixed. If you are the administrator see for common causes of this Problem.
For now you may choose to:
1. Pause sync for this server and suppress this warning for some time. (This warning might come up again when you resume sync and the problem was not fixed.)
- 1 Hr
- 1 Day
2. Trust this certificate anyway. WARNING THIS IS DANGEROUS, NC CLient can not ensure that it is communicating with the correct server! You might be under attack.
---------
I believe this would do a lot to prevent people from trusting potentially bad certificates and it is probably not very hard to implement. :)
### Which files are affected by this bug
?
### Operating system
Linux
### Which version of the operating system you are running.
Arch Linux
### Package
Distro package manager
### Nextcloud Server version
24.0.7
### Nextcloud Desktop Client version
3.6.6-1
### Is this bug present after an update or on a fresh install?
Fresh desktop client install
### Are you using the Nextcloud Server Encryption module?
Encryption is Disabled
### Are you using an external user-backend?
- [ ] Default internal user-backend
- [ ] LDAP/ Active Directory
- [ ] SSO - SAML
- [ ] Other
### Nextcloud Server logs
_No response_
### Additional info
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.