How do i get cURL to use https

后端 未结 2 1383
囚心锁ツ
囚心锁ツ 2021-01-15 17:50

I\'m on Ubuntu 14.04.2 LTS. cURL\'s installed but does not include HTTPS as a protocol that it will use.

For example:

curl https://npmjs.org/install.         


        
2条回答
  •  天命终不由人
    2021-01-15 18:43

    I still don't know why using Aptitude installs a version without support for HTTPS but building from scratch did the trick:

    git clone https://github.com/bagder/curl.git
    sudo apt-get build-dep curl
    cd curl
    ./buildconf
    ./configure
    make
    sudo make install 
    

    Now curl -V yields

    Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtmp rtsp smb smbs smtp smtps telnet tftp
    Features: IDN IPv6 Largefile NTLM NTLM_WB SSL libz TLS-SRP UnixSockets
    

    Oh and the reason I needed this in the first place is because NVM gave me N/A when trying to download a version of Node or get a listing of available versions with nvm ls-remote. That was caused by cURL not working for HTTPS requests.

提交回复
热议问题