Jan 25

用编译 Stubby 的方法行不通,因为 Curl 的编译配置文件会发现系统有两个版本的 OpenSSL 而导致编译失败。所以选择 WolfSSL

#wolfssl
./configure --prefix=/mmc --enable-static=yes
make && make install

#Curl
./configure --prefix=/opt --with-ca-bundle=/opt/etc/ssl/certs/ca-certificates.crt --with-wolfssl --without-ssl --with-nghttp2 --disable-ldap --disable-shared --enable-ares
make -j2 LDFLAGS="-all-static -s" LIBS="-ldl"

编译出来的 Curl:

curl2 -V
curl 7.63.0 (armv7l-unknown-linux-uclibceabi) libcurl/7.63.0 wolfSSL/3.15.7 zlib/1.2.11 c-ares/1.15.0 libpsl/0.12.0 (no IDNA support) nghttp2/1.35.1
Release-Date: 2018-12-12
Protocols: dict file ftp ftps gopher http https imap imaps pop3 pop3s rtsp smtp smtps telnet tftp
Features: AsynchDNS IPv6 Largefile SSL libz HTTP2 UnixSockets PSL

TLSv1.3 测试:

curl2 -I -v --tlsv1.3 https://quakemachinex.com
* Trying 113.67.73.162...
* TCP_NODELAY set
* Connected to quakemachinex.com (113.67.73.162) port 443 (#0)
* successfully set certificate verify locations:
* CAfile: /opt/etc/ssl/certs/ca-certificates.crt
CApath: none
* SSL connection using TLSv1.3 / TLS13-AES256-GCM-SHA384