Set a client certificate even when encountering an AuthenticationRequiredError (error code 401)
- 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
We have set up an in-house Nextcloud server and require client certificate verification for access from the internet.
As expected, if a client certificate is not set in the web browser, a "401 Authorization Required" error will be displayed. And, once we set up the client certificate, we can access Nextcloud correctly.

However, when attempting to access the Nextcloud server using Nextcloud Desktop, the option to add a client certificate is not available.
### Steps to reproduce
Nextcloud Desktop is unable to set the client certificate in the case of an AuthenticationRequiredError (error code 401).

### Expected behavior
We would like to have the ability to set a client certificate even when encountering an AuthenticationRequiredError (error code 401).
We understand that Nextcloud Desktop has the ability to configure client certificates.


However, Nextcloud Desktop is unable to set the client certificate in the case of an AuthenticationRequiredError (error code 401).

We have removed the following line of code from the case statement to avoid the aforementioned error screen and display the screen for adding the client certificate.
https://github.com/nextcloud/desktop/blob/v3.12.5/src/gui/owncloudsetupwizard.cpp#L448
`case QNetworkReply::AuthenticationRequiredError:`
We believe there are other users with similar needs, so we would like to request the implementation of a feature that allows setting the client certificate even in the case of an AuthenticationRequiredError (error code 401).
Alternatively, if there is already another method available to add a client certificate, please inform us.
### Which files are affected by this bug
null
### Operating system
Windows
### Which version of the operating system you are running.
Windows 10
### Package
Distro package manager
### Nextcloud Server version
24.0.3
### Nextcloud Desktop Client version
3.12.50
### 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 Enabled
### 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.