Mac curl 支持 https安装

openssl 安装

  • wget https://www.openssl.org/source/openssl-3.0.1.tar.gz

  • tar xfvz openssl-3.0.1.tar.gz

  • cd openssl-3.0.1

  • ./config --prefix=/usr/local/openssl

  • make

  • sudo make install

  • /usr/local/openssl/bin/openssl version

curl 安装

  • wget https://curl.haxx.se/download/curl-7.82.0.zip

  • unzip curl-7.82.0.zip

  • ./configure --with-ssl=/usr/local/openssl

  • make

  • sudo make install

MAC命令行下使用代理

  • vim .zshrc

  • alias setproxy="export https_proxy=http://127.0.0.1:1087 http_proxy=http://127.0.0.1:1087 all_proxy=socks5://127.0.0.1:1080 no_proxy=localhost,192.168.,127.0."

  • alias unsetproxy="unset ALL_PROXY; unset https_proxy; unset http_proxy; unset no_proxy"

  • 某些https接口只配置 all_proxy 没用,会连接超时,需要配置上 https_proxy

参考文档

  • https://www.jianshu.com/p/1e5e72089a84 【macOS】brew安装 -

  • https://www.codeleading.com/article/88304682929/ mac 在php工程中实现curl的https访问 - 代码先锋网

  • https://support.securly.com/hc/en-us/articles/206058318-How-to-install-the-Securly-SSL-certificate-on-Mac-OSX-

你可能感兴趣的:(Mac curl 支持 https安装)