Articles of curl

带cURL的SSL与sudo cURL,wget,openssl

以root身份使用cURL时,一切工作正常: $ sudo curl -vvv https://test.example.org/ > /dev/null * Connected to test.example.org (1.2.3.4) port 443 (#0) * Initializing NSS with certpath: sql:/etc/pki/nssdb * CAfile: /etc/pki/tls/certs/ca-bundle.crt CApath: none * SSL connection using TLS_DHE_RSA_WITH_AES_128_GCM_SHA256 * Server certificate: * subject: CN=test.example.org,O=organization,L=location,ST=state,C=country * start date: Okt 26 06:58:41 2015 GMT * expire date: Okt 24 06:58:41 2020 GMT * […]

tcp通过curl和netcat重新传输

我试图设置iptables导致docker容器之间的现实networking故障。 在服务器上,我运行netcat -lk 1234和一个Erlang牛仔服务器。 在客户端上运行客户端: echo blah | netcat myserver 1234 curl myserver/xyz 最初,这些工作正常,有客户端 – 服务器通信的证据。 接下来,我在客户端的OUTPUT上引入iptables DROP规则。 iptables -A OUTPUT -j DROP echo blah | netcat myserver 1234 curl myserver/xyz netcat和curl通信都没有通过, 直到我删除了DROP规则,在这一点上他们无缝地恢复! 最后,我重复上述,但在删除DROP规则之前,我ctrl-c客户端可执行文件。 删除DROP规则后,我发现服务器没有收到客户请求。 我的结论是netat / curl客户端必须试图无限期地重新传输? 我不应该最终期望失败吗? 顺便说一句,同样的事情发生在与其他客户,例如。 Erlang http / websocket_client。

curl仅在我的计算机上从服务器返回“空回复”时排除连接问题

无论什么原因,当我的电脑(Mac OS X 10.11.1)在其他电脑上正常工作时,无法使用curl从网站获取网页。 平也工作,但curl不: $ ping www.latex-tutorial.com PING latex-tutorial.com (162.252.172.25): 56 data bytes 64 bytes from 162.252.172.25: icmp_seq=0 ttl=54 time=76.116 ms 64 bytes from 162.252.172.25: icmp_seq=1 ttl=54 time=74.538 ms 64 bytes from 162.252.172.25: icmp_seq=2 ttl=54 time=90.379 ms ^C — latex-tutorial.com ping statistics — 3 packets transmitted, 3 packets received, 0.0% packet loss round-trip min/avg/max/stddev […]

HTTP标头不匹配

php的返回值和nginx中设置的值有什么区别? 当我运行: curl -I mydomain.com 我得到了预期的结果(我keep-alive off ) Connection: close 但是当我输出$_SERVER[HTTP_CONNECTION]在同一个域时,我得到: Connection: keep-alive 我不知道为什么PHP返回保持活动,其他地方我拉头,它显示连接closures。

PHP的cURL不工作

从我的前辈inheritance的Apache服务器上的php cURL扩展不起作用。 我使用下面的代码: $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'https://www.linkedin.com/nhome/'); curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.73 Safari/537.36"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_TIMEOUT, 10); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_VERBOSE, true); curl_setopt($ch, CURLOPT_STDERR, $fp); $response = curl_exec($ch); $errmsg = curl_error($ch); $cInfo = curl_getinfo($ch); curl_close($ch); 哪个返回错误: * name lookup timed […]

curlNSS错误-12156 ssl连接错误

在AWS服务器上运行cURL时出现以下错误: curl -v –insecure –disable-epsv -l ftps://foo.com/ –user "foo:bar" * Initializing NSS with certpath: sql:/etc/pki/nssdb * warning: ignoring value of ssl.verifyhost * skipping SSL peer certificate verification * NSS error -12156 * Closing connection #0 * SSL connect error curl: (35) SSL connect error 这个错误非常相似: curl:(35)SSL连接错误,但错误代码是-12156 。 我似乎无法在文档中find有关此错误代码的任何信息: https : //developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/SSL_functions/sslerr.html 有没有人看到这个错误,或可以指示我的文档,会给我更多关于错误代码的细节?

OpenSSL Header版本!=影响HTTP / 2的OpenSSL Library版本,用于APNS

我在WAMP上的openSSL上有这个奇怪的组合。 我的Windows命令提示符openssl version返回库版本 – > OpenSSL 1.0.2h 2016年5月3日 而我的PHPcurl调用 – echo "openssl version text: " . OPENSSL_VERSION_TEXT . "\n"; echo "openssl version text: " . OPENSSL_VERSION_TEXT . "\n"; 返回标题版本:openssl version text:OpenSSL 1.0.1t 2016年5月3日 我想知道如何更新OpenSSL头版本,因为我需要1.0.2为了APNS工作,因为我还在 HTTP / 2客户端前言string丢失或损坏。 接收字节的hex转储:504f5354202f332f6465766963652f613433646466376235 我正在使用Windows Server 2008 Windows NT OMEGA 6.1 build 7601(Windows Server 2008 R2企业版服务包1)AMD64 WAMP Apache / 2.4.17(Win64)Apache显示Apache / […]

是否有可能通过ngrok公开本地主机上的HTTP代理?

我有本地主机上安装tinyproxy (我也尝试过squid和失败类似)。 它运行在8888端口。这个工作: curl -x localhost:8888 http://www.google.com 我看到tinyproxy日志输出。 现在我运行最新版本的ngrok并build立以下转发: http://<identifier>.ngrok.io -> localhost:8888 如果我在浏览器中打开http://<identifier>.ngrok.io ,ngrok连接计数器会上升,我成功看到tinyproxy的“未实现”错误页面。 但是,这失败了: curl -x <identifier>.ngrok.io:80 http://www.google.com # => curl: (56) Received HTTP code 404 from proxy after CONNECT ngrok柜台不上去,我看不到tinproxy日志中的消息,暗示这个失败是在ngrok接受连接之前。 我在这里错过了什么? 我曾经假设ngrok和tinyproxy都会转发HTTP请求,但似乎在curl -x后台可能会有另一个协议运行。 有没有办法成功build立代理链开始ngrok,并通过我的本地主机?

Google Firebase云消息传递不在ca_root_nss中?

我们正在尝试将推送服务迁移到Google Firebase云消息传递。 在运行linux的开发机器上,一切都很好,但是在集成系统(像FreeBSD那样运行在FreeBSD上)上有一个奇怪的错误。 在Linux上,我可以“蜷缩https://fcm.googleapis.com/fcm/send ”并获得一个propper响应,但是在FreeBSD中它说: curl: (60) SSL certificate problem: unable to get local issuer certificate 和“ https://fcm.googleapis.com/fcm/send ”取回响应: Certificate verification failed for /C=US/O=GeoTrust Inc./CN=GeoTrust Global CA 34380949368:error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed:/usr/src/secure/lib/libssl/../../../crypto/openssl/ssl/s3_clnt.c:1180: fetch: https://fcm.googleapis.com: Authentication error ca_root_nss文件被更新,pkg信息ca_root_nss表示: ca_root_nss-3.27.1 Name : ca_root_nss Version : 3.27.1 Installed on : Fri Nov 11 15:54:47 2016 CET Origin : security/ca_root_nss […]

debuggingcurlFTPS连接,使用客户端身份validation证书(OpenSSL)

(从StackOverflow移动)我被要求使用客户端身份validation证书来设置FTPS连接。 我是客户端,连接到服务器。 我在Windows 7工作站上,在防火墙后面,尽pipe这个连接最终将在专用的CentOS虚拟机上使用。 其他一些信息: 仅限TLS 1.2 仅被动模式 我的WAN IP被列入白名单 目前,我正在连接到testingurl 没有出站防火墙(只有入站规则) 密钥应以PEM格式发送 我从Comodo购买了证书,并用IE10生成了证书。 我使用私钥和扩展属性以.pfx格式从IE中导出了完整的证书。 我写了一个batch file,使用OpenSSL从.pfx中提取必要的部分: ::Extract the private key from the PFX openssl pkcs12 -in comodo.pfx -nocerts -out encrypted.key ::Extract unencrypted private key openssl rsa -in encrypted.key -out decrypted.key ::Extract the public cert in Base64 from the PFX openssl pkcs12 -in comodo.pfx -clcerts […]