新安排的工作需要发post请求到一个https的url,然后就发现https不支持
搜了很久都是说重装curl的,因为是公司的环境,库非常的古老,根本不敢更新啊,谁知道以前的代码有没有靠什么奇奇怪怪的bug运行起来的,要是一更新大面积崩不是分分钟要跑路。。。所以看看有没有大佬有办法可以解决一下这个问题?
$ curl -V
curl 7.21.6 (x86_64-unknown-linux-gnu) libcurl/7.81.0-DEV zlib/1.2.11 OpenLDAP/2.4.44
Protocols: dict file ftp gopher http imap ldap mqtt pop3 rtsp smtp telnet tftp
Features: AsynchDNS IPv6 Largefile libz
$ openssl version
WARNING: can't open config file: /data02/emccbm/ob_rel_hu/ssl/openssl.cnf
OpenSSL 1.0.1u 22 Sep 2016
我还试过这个 看起来是重装的确就能完事的那种
$ ./configure --with-openssl
.
.
.
curl version: 7.82.0
SSL: enabled (OpenSSL)
SSH: no (--with-{libssh,libssh2})
zlib: enabled
brotli: no (--with-brotli)
zstd: no (--with-zstd)
GSS-API: no (--with-gssapi)
GSASL: no (libgsasl not found)
TLS-SRP: no (--enable-tls-srp)
resolver: POSIX threaded
IPv6: enabled
Unix sockets: enabled
IDN: no (--with-{libidn2,winidn})
Build libcurl: Shared=yes, Static=yes
Built-in manual: enabled
--libcurl option: enabled (--disable-libcurl-option)
Verbose errors: enabled (--disable-verbose)
Code coverage: disabled
SSPI: no (--enable-sspi)
ca cert bundle: /etc/pki/tls/certs/ca-bundle.crt
ca cert path: no
ca fallback: no
LDAP: enabled (OpenLDAP)
LDAPS: enabled
RTSP: enabled
RTMP: no (--with-librtmp)
PSL: no (libpsl not found)
Alt-svc: enabled (--disable-alt-svc)
HSTS: enabled (--disable-hsts)
HTTP1: enabled (internal)
HTTP2: no (--with-nghttp2, --with-hyper)
HTTP3: no (--with-ngtcp2, --with-quiche)
ECH: no (--enable-ech)
Protocols: DICT FILE FTP FTPS GOPHER GOPHERS HTTP HTTPS IMAP IMAPS LDAP LDAPS MQTT POP3 POP3S RTSP SMB SMBS SMTP SMTPS TELNET TFTP
Features: AsynchDNS HSTS HTTPS-proxy IPv6 Largefile NTLM NTLM_WB SSL UnixSockets alt-svc libz
对了,看了下wget支持https可以使用不知道是否可以替代curl发送post请求?换个方法应该也没事反正就是发发post请求罢了
$ wget -V
GNU Wget 1.14 built on linux-gnu.
+digest +https +ipv6 +iri +large-file +nls +ntlm +opie +ssl/openssl
绝大多数情况下wget和curl可以互相替换,他们的功能有重叠。
话说回来你的这个curl本身十有八九也是自己编译的,那个openssl的路径都暴露了。你还可以自己静态编译一个curl扔进去就行了
看了下github上也有现成的,有人维护了一个: https://github.com/moparisthe...