Eu recentemente reinstalei meu computador e instalei o Linux Subsystem, o que eu sempre faço. Então esta é uma nova instalação completa. Quando eu quis rodar o compositor notei algo estranho. Ele falhou porque não conseguiu estabelecer uma conexão 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.
Depois de tentar um pouco mais, notei que isso acontece, não importa qual repositório do GitHub eu tente clonar via https e também se aplica a qualquer conexão via curl ou outros comandos que se conectam usando TLS. Eu tentei várias soluções propostas em outros tópicos, como atualizar ca-certificates , reinstalar Ubuntu no Windows 10, baixando link e apontando para isso em php.ini , certificando-se de que ipv6 não é o preferido método no Ubuntu etc.
Anteriormente, quando usei o Ubuntu no Windows 10 , acabei de instalar e tudo funcionou sem problemas como este.
Teste a versão do Windows do GIT e funcionou bem.
Para demonstrar, parece afetar todos os aplicativos Bash. Também testei o seguinte
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
e
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.
A versão instalada é
lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 16.04.4 LTS
Release: 16.04
Codename: xenial