macOS编译libcurl支持https

下载openssl

https://www.openssl.org/source/
自己为了方便打包签名,编译成静态库
这里下载的版本为openssl-1.1.1c.tar.gz

 

tar -zxf openssl-1.1.1c.tar.gz
cd openssl-1.1.1c
./config -fPIC no-shared --prefix=/usr/local
make
sudo make install

下载libcurl

自己为了方便打包签名,同样编译成了静态库
这里下载的版本为curl-7.61.0.zip

 

unzip curl-7.61.0.zip
cd curl-7.61.0
./configure CFLAGS=-fPIC --disable-ldap --disable-ldaps --enable-shared=no
make

 

解决方法

在curl-7.61.0目录执行

 

./configure CFLAGS=-fPIC --disable-ldap --disable-ldaps --enable-shared=no --without-darwinssl --with-ssl=/usr/local
make
sudo make install

--without-darwinssl 禁用Apple OS本机SSL/TLS
--with-ssl=/usr/local 指定openssl的位置


来源:简书 https://www.jianshu.com/p/5e46df9c5fe7

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章