WingetUI: 'the server certificate did not match the expected values' - Kaspersky Protection changes the certificate that wingetUI expects

2 min read 28-10-2024
WingetUI: 'the server certificate did not match the expected values' - Kaspersky Protection changes the certificate that wingetUI expects

WingetUI is a user-friendly interface for Windows Package Manager (winget), allowing users to easily manage software installations and updates. However, some users encounter the error message: "the server certificate did not match the expected values." This issue often arises when Kaspersky Protection modifies the SSL certificate that WingetUI expects for a secure connection.

Original Code Example

This problem can manifest in various ways when users try to use WingetUI. While the specific code related to this issue may vary, users typically see logs or errors similar to this when the certificate mismatch occurs:

Error: Unable to validate the server certificate. 
The server certificate did not match the expected values.

Analyzing the Problem

What Causes the Issue?

  1. Kaspersky’s SSL Scanning: Kaspersky has an SSL scanning feature designed to intercept and inspect encrypted traffic for threats. While this enhances security for most users, it can sometimes interfere with applications that expect specific SSL certificates, such as WingetUI.

  2. Certificate Validation: WingetUI validates SSL certificates to ensure that the data it receives from package repositories is secure and has not been tampered with. If Kaspersky replaces the original certificate with its own, this can lead to the validation failure that users experience.

Steps to Resolve the Issue

If you're experiencing this error with WingetUI, you can try the following solutions:

  1. Disable SSL Scanning: Temporarily disable Kaspersky’s SSL scanning feature. This can often resolve the mismatch since WingetUI will then be able to connect using the expected certificate. Here’s how to do it:

    • Open Kaspersky.
    • Go to Settings.
    • Navigate to Protection > Web Anti-Virus.
    • Uncheck the option that enables SSL scanning.
  2. Add Exceptions: Instead of completely disabling SSL scanning, you can add WingetUI to the exceptions list:

    • In Kaspersky, go to Settings.
    • Find the Exclusions section.
    • Add WingetUI’s executable or the domain of the repository you're trying to access to the exclusion list.
  3. Update Kaspersky: Ensure that your Kaspersky software is up to date. Occasionally, software updates can resolve compatibility issues that cause problems with certificate validation.

  4. Check WingetUI Updates: Make sure that you are running the latest version of WingetUI. Updates often fix bugs and enhance compatibility with various security software.

Practical Example

Let’s say you are trying to install a package using WingetUI, but you encounter the certificate error. Following the steps above, you decide to disable the SSL scanning feature in Kaspersky temporarily. After doing so, you retry the installation, and WingetUI successfully connects to the package repository without any errors.

Conclusion

If you’re using WingetUI and encountering the "server certificate did not match the expected values" error due to Kaspersky Protection, this is a manageable issue. By adjusting the settings in Kaspersky, you can ensure that WingetUI functions correctly without compromising your system's security.

Additional Resources

Feel free to explore these resources for more detailed guidance on managing your software installations securely.