openssl 安装
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 安装
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访问 - 代码先锋网