本文最后更新于 469 天前,其中的信息可能已经有所发展或是发生改变。
当想要用libcurl去请求https资源的时候,就需要带SSL的libcurl
首先静态编译openssl
apt install git -y
git clone https://github.com/openssl/openssl
cd openssl
./config -fPIC no-shared --prefix=/usr/local no-dso no-ssl3
make && make install
接着静态编译链接了openssl的libcurl
apt install wget unzip -y
wget https://curl.se/download/curl-7.84.0.zip
unzip curl-7.84.0.zip
cd curl-7.84.0
./configure --prefix=/usr/local --with-ssl=/usr/local --disable-shared
make && make install
搞定收工!
libcurl的静态链接库在目录/usr/local/lib下的libcurl.a