為什麼我會收到“libcurl 中不支持或禁用協議 http”?
我正在嘗試使用以下命令將儲存庫添加到我的 OpenSUSE Leap 42.3(在 WSL 上執行)。
sudo zypper addrepo https://download.opensuse.org/repositories/devel:languages:php/openSUSE_Leap_42.3/devel:languages:php.repo
我收到以下錯誤。
’ https://download.opensuse.org/repositories/devel:languages:php/openSUSE_Leap_42.3/devel:languages:php.repo ‘的下載(捲曲)錯誤:錯誤程式碼:錯誤的 URL 錯誤消息:不支持協議 http或在 libcurl 中禁用
當我使用 https 作為協議時,我發現錯誤消息正在談論 http 的事實令人困惑,而且更令人困惑的是,
curl --version
建議 https 的輸出是受支持的協議。curl 7.37.0 (x86_64-suse-linux-gnu) libcurl/7.37.0 OpenSSL/1.0.2j zlib/1.2.8 libidn/1.28 libssh2/1.4.3
協議:dict 文件 ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp scp sftp smtp smtps telnet tftp
特性:AsynchDNS GSS-Negotiate IDN IPv6 Largefile NTLM NTLM_WB SSL libz TLS-SRP
使用
zypper info libssl43
,我得到以下輸出。Information for package libssl43: --------------------------------- Repository : oss Name : libssl43 Version : 2.5.3-6.1 Arch : x86_64 Vendor : openSUSE Installed Size : 360.0 KiB Installed : Yes Status : up-to-date Source package : libressl-2.5.3-6.1.src Summary : An SSL/TLS protocol implementation Description : LibreSSL is an open-source implementation of the Secure Sockets Layer (SSL) and Transport Layer Security (TLS) protocols. It derives from OpenSSL and intends to provide a more secure implementation.
的輸出
zypper info libcrypto41
如下。(libcrypto41 是 libssl43 的依賴項。)Information for package libcrypto41: ------------------------------------ Repository : oss Name : libcrypto41 Version : 2.5.3-6.1 Arch : x86_64 Vendor : openSUSE Installed Size : 2.0 MiB Installed : Yes (automatically) Status : up-to-date Source package : libressl-2.5.3-6.1.src Summary : An SSL/TLS protocol implementation Description : The "crypto" library implements a wide range of cryptographic algorithms used in various Internet standards. The services provided by this library are used by the LibreSSL implementations of SSL, TLS and S/MIME, and they have also been used to implement SSH, OpenPGP, and other cryptographic standards.
如何使用 https 網址?我可以改用 http,但我不想走那條路。
我發現Thread: zypper https urls: Protocol “http” not supported or disabled in libcurl,其中包含指向Thread: Cached files in /home/~/.cache/kioexec/krun/####_# 的連結?如何避免?
按照那些文章中所說的,我嘗試
curl https://download.opensuse.org/repositories/devel:languages:php/openSUSE_Leap_42.3/devel:languages:php.repo
了 ,它輸出以下內容。<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>301 Moved Permanently</title> </head><body> <h1>Moved Permanently</h1> <p>The document has moved <a href="http://download.opensuse.org/repositories/devel:languages:/php/openSUSE_Leap_42.3/devel:languages:php.repo">here</a>.</p> <hr> <address>Apache/2.2.34 (Linux/SUSE) Server at download.opensuse.org Port 443</address> </body></html>
因此,
https://download.opensuse.org/repositories/devel:languages:php/openSUSE_Leap_42.3/devel:languages:php.repo
被重定向到http://download.opensuse.org/repositories/devel:languages:/php/openSUSE_Leap_42.3/devel:languages:php.repo
並且,由於重定向是從 https:// 到 http://,因此 Zypper 不會跟隨它。簡而言之,伺服器尚未使用 https:// URL,臨時解決方法是使用 http:// URL。我的 OpenSuse 42.3 安裝沒有任何問題。