Resolving Certificate Verification Failure in WSL Ubuntu: TLS Interception
This article provides a detailed guide on how to resolve certificate verification failure when using the add-apt-repository command in WSL (Windows Subsystem for Linux) Ubuntu distribution. The primary focus of this article is to explain the key concepts related to this issue and provide a step-by-step solution.
Introduction
TLS (Transport Layer Security) interception is a security measure used by many organizations to monitor and inspect network traffic for potential security threats. However, this security measure can sometimes cause issues when using Linux commands, such as add-apt-repository, in WSL Ubuntu distribution.
Understanding Certificate Verification Failure
When using the add-apt-repository command, the system checks for a valid SSL/TLS certificate to verify the authenticity of the repository. If the certificate verification fails, the system will display an error message indicating that the certificate cannot be verified.
Resolving Certificate Verification Failure
To resolve the certificate verification failure issue, you need to disable TLS interception for the WSL Ubuntu distribution. Here are the steps to follow:
Open the Windows Command Prompt (CMD) and run the following command to stop the WSL service:
wsl --shutdownOpen the Windows Registry Editor (regedit) and navigate to the following registry key:
HKEY\_LOCAL\_MACHINE\SYSTEM\ControlSet001\Services\WSL\Parameters\Protocols\wsl$Create a new DWORD value named
DisableCertificateCheckand set its value to 1.Start the WSL service again by running the following command in the Windows Command Prompt (CMD):
wslOpen the WSL Ubuntu terminal and run the following command to update the package lists:
sudo apt-get update
TLS interception can sometimes cause issues when using Linux commands in WSL Ubuntu distribution. By disabling TLS interception, you can resolve the certificate verification failure issue and continue using the add-apt-repository command without any issues. It is important to note that disabling TLS interception may have security implications, and it is recommended to consult with your organization's IT department before making any changes.
References
Certificate Verification Errors When Adding Repositories in WSL
Add-apt-repository fails with certificate verification failed
Types of references included:
- Online resources