TLS 在 WSL 中对 Ubuntu 不起作用

TLS 在 WSL 中对 Ubuntu 不起作用

我最近重新安装了电脑,并安装了 Linux 子系统,我一直都是这么做的。所以这是一个全新的安装。当我想运行作曲家我注意到一些奇怪的事情。它失败了,因为它无法建立 TLS 连接。

 [RuntimeException]  Failed to clone https://github.com/inquam/colors.php via https, ssh protocols, aborting.

 - https://github.com/inquam/colors.php    Cloning into bare repository '/home/danlil/.cache/composer/vcs/https---
github.com-inquam-colors.php'...
    fatal: unable to access 'https://github.com/inquam/colors.php/': gnutls_handshake() failed: The TLS connection was non-properly terminated.

 - [email protected]:inquam/colors.php
    Cloning into bare repository '/home/danlil/.cache/composer/vcs/https---github.com-inquam-colors.php'...
    Warning: Permanently added the RSA host key for IP address '192.30.253.113' to the list of known hosts.
    Permission denied (public key).
    fatal: Could not read from remote repository.

    Please make sure you have the correct access rights
    and the repository exists.

经过进一步尝试,我发现无论我尝试通过 https 克隆哪个 GitHub 存储库,都会发生这种情况,并且它也适用于通过以下方式的任何连接:卷曲或其他使用 TLS 连接的命令。我尝试了其他线程中提出的几种解决方案,例如更新ca 证书,重新安装Ubuntu在 Windows 10 上,下载https://curl.haxx.se/ca/cacert.pem并指出php.ini, 确保IPv6 协议不是首选方法UbuntuETC。

以前我用过UbuntuWindows 10我刚刚安装完毕,一切正常,没有任何类似问题。

测试 Windows 版本的 GIT 并且运行良好。

为了证明它似乎影响每个 Bash 应用程序,我还测试了以下内容

me@DATHREADRIPPER:/mnt/e/src$ **php -r 'echo 
file_get_contents("https://packagist.org/packages.json");'**

PHP Warning:  file_get_contents(): Failed to enable crypto in Command line 
code on line 1
PHP Warning:  file_get_contents(https://packagist.org/packages.json): failed to open stream: operation failed in Command line code on line 1

me@DATHREADRIPPER:/mnt/e/src$ **wget https://www.youtube.com/**

--2018-04-22 19:51:13--  https://www.youtube.com/
Resolving www.youtube.com (www.youtube.com)... 172.217.21.174, 216.58.207.206, 216.58.211.142, ...
Connecting to www.youtube.com (www.youtube.com)|172.217.21.174|:443... connected.
Unable to establish SSL connection.

安装的版本是

lsb_release -a

No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 16.04.4 LTS
Release:        16.04
Codename:       xenial

相关内容