标签: curl

WSL-Docker:curl:(60) 无法获取本地颁发者证书

重新配置 PC 后,我无法正确使用 Docker,因为某些curl 命令由于 SSL/TLS 问题而被拒绝。

仅在一个示例中curl -vfsSL https://apt.releases.hashicorp.com/gpg返回以下错误:

*   Trying 52.222.214.125:443...
* TCP_NODELAY set
* Connected to apt.releases.hashicorp.com (52.222.214.125) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
*   CAfile: /etc/ssl/certs/ca-certificates.crt
  CApath: /etc/ssl/certs
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
* TLSv1.3 (IN), TLS handshake, Server hello (2):
* TLSv1.3 (OUT), TLS change cipher, Change cipher spec (1):
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
* …
Run Code Online (Sandbox Code Playgroud)

ubuntu ssl curl windows-subsystem-for-linux

4
推荐指数
1
解决办法
3万
查看次数

如何启用 curl,已安装的 Ubuntu LAMP 堆栈?

我已经安装了 ubuntu Lamp stack。但是 curl 没有启用,我也找不到 INI 文件中列出的扩展名,我手动添加但它也没有工作。

那么应该如何启用 Curl 呢?

ubuntu php lamp curl

3
推荐指数
1
解决办法
5731
查看次数

在 CentOS 6.3 上将 curl 升级到最新版本

认为这将是一个简单的过程,但我想不是。我需要在 CentOS 6.3 上安装最新版本的 CURL(7.23 或更高版本)。

如果我这样做:

须藤百胜升级卷曲

它只是告诉我无事可做(一切都是最新的)。

所以我关注了其他一些 ServerFault 帖子,并尝试了这个:

须藤 rpm -i http://mirror.city-fan.org/ftp/contrib/sysutils/Mirroring/libcurl-7.29.0-2.0.cf.rhel6.x86_64.rpm

但这告诉我:

警告:/var/tmp/rpm-tmp.4L8Nyj:标题 V3 DSA/SHA1 签名,密钥 ID b56a8bac:NOKEY 错误:依赖项失败:libcurl-7.29 需要 c-ares(x86-64) >= 1.9.1。 libcurl-7.29.0-2.0.cf.rhel6.x86_64 需要 0-2.0.cf.rhel6.x86_64 libssh2(x86-64) >= 1.4.3

那么我实际上必须做什么才能升级?

centos curl

3
推荐指数
1
解决办法
2万
查看次数

带身份验证但不加密的 SSL

是否可以设置 lighttpd 服务器和 curl 客户端,以便客户端和服务器都验证彼此的自签名 SSL 证书,但下载文件时没有 SSL 加密?

我该如何设置?

ssl web-server lighttpd curl

3
推荐指数
1
解决办法
561
查看次数

curl 收到 302 或其他东西,很奇怪

我有以下 curl 命令

curl -X POST -w "\nRESULT CODE:%{http_code}\n" --insecure --header "Content-Type:application/json" --user robot-midc:1ZSXM7 -d @table.json http://databus.nrel.gov/api/registerV1
Run Code Online (Sandbox Code Playgroud)

我收到以下回复

<html>
<head><title>302 Found</title></head>
<body bgcolor="white">
<center><h1>302 Found</h1></center>
<hr><center>nginx/1.2.4</center>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)

嗯,我如何检查实际的 http 代码,它是 302,因为 curl 文档声称他们遵循重定向,所以我不确定发生了什么?

谢谢,院长


嗯,也许这是一个错误,因为 curl 不像浏览器那样遵循 http 到 https 重定向????我的问题很简单,负载均衡器总是重定向到 https 并且我在那里有 http 在线......太奇怪了,curl 给出更好的错误会很好,因为它不会重定向到 https(即。不遵循文档所述的所有重定向)。

curl

3
推荐指数
2
解决办法
1万
查看次数

LetsEncrypt:连接中出现未知的 SSL 协议错误

我有一个带有 LE 证书的主机,它在浏览器中运行良好,但我仍然无法使用curl, openssl, wget, POST(libwww-perl) 进行连接:

卷曲

# curl -v -3 https://example.com/
* Hostname was NOT found in DNS cache
*   Trying 123.123.123.123...
* Connected to example.com (123.123.123.123) port 443 (#0)
* successfully set certificate verify locations:
*   CAfile: none
  CApath: /etc/ssl/certs
* SSLv3, TLS handshake, Client hello (1):
* Unknown SSL protocol error in connection to example.com:443 
* Closing connection 0
Run Code Online (Sandbox Code Playgroud)

openssl

# openssl s_client -connect example.com:443
CONNECTED(00000003)
write:errno=104
---
no peer certificate …
Run Code Online (Sandbox Code Playgroud)

ssl openssl curl apache-2.4 lets-encrypt

3
推荐指数
1
解决办法
2317
查看次数

如何在 ReverseProxied 网站上“覆盖”服务器响应标头?

我在本地网络的不同服务器上运行几个网站。所有网站都通过一台添加了 HTTPS 并监控流量的服务器进行代理。

目前,如果有人做:

curl -I subdomain.domain.tld
Run Code Online (Sandbox Code Playgroud)

结果是:

curl -I https://subdomain.domain.tld
HTTP/1.1 200 OK
Date: Fri, 13 Jan 2017 09:19:02 GMT
Server: Jetty(8.y.z-SNAPSHOT)
Content-Type: text/html
Content-Length: 2379
Last-Modified: Tue, 10 Jan 2017 11:15:29 GMT
Run Code Online (Sandbox Code Playgroud)

如何使用 ReverseProxy 的另一个响应“覆盖”代理背后的服务器提供的响应?

例如,我希望我的输出看起来像这样(如果可能)

curl -I https://dubdomain.domain.tld
HTTP/1.1 200 OK
Date: Fri, 13 Jan 2017 09:19:02 GMT
Server: Apache24 (or even something else)
Content-Type: text/html
Content-Length: 2379
Last-Modified: Tue, 10 Jan 2017 11:15:29 GMT
Run Code Online (Sandbox Code Playgroud)

这是可以实现的吗?

reverse-proxy http-headers curl apache-2.4

3
推荐指数
1
解决办法
6842
查看次数

适用于 Paypal 的 Centos 5.11 OpenSSL TLS 1.2

我在运行 Centos 5.11 的服务器上运行一个网站 - 现在我知道 EOL,但暂时无法升级。该网站运行与 Paypal 集成的 Sellerdeck 软件进行支付。

在接下来的一个月左右,Paypal 将要求我使用 TLS 1.2 [1] 来连接它们,而 5.11 (0.9.8b) 中安装的默认 OpenSSL 版本不支持该版本。

我已按照说明 [2] 安装第二个版本的 OpenSSL,以及链接到新版本 OpenSSL 的第二个 Curl 版本,它将支持 TLS 1.2,但它仍然没有通过 Paypal 测试。

Centos 5.11 在 /usr/local/ 中带有 OpenSSL 1.0.2k:

/usr/local/bin/curl https://tlstest.paypal.com
curl: (35) Unknown SSL protocol error in connection to tlstest.paypal.com:443
Run Code Online (Sandbox Code Playgroud)

Centos 6.9 与 OpenSSL 1.0.1e-fips

curl https://tlstest.paypal.com
PayPal_Connection_OK
Run Code Online (Sandbox Code Playgroud)

任何人都可以帮助我指出正确的方向,为什么连接不能与更新的 OpenSSL 一起使用?

非常感谢

凯文

1 - https://www.paypal-knowledge.com/infocenter/index?page=content&widgetview=true&id=FAQ1914&viewlocale=en_US

2 - https://miteshshah.github.io/linux/centos/how-to-enable-openssl-1-0-2-a-tlsv1-1-and-tlsv1-2-on-centos-5-and- rhel5/

详细的非工作输出:

/usr/local/bin/curl -Ivvv https://tlstest.paypal.com
* Rebuilt URL …
Run Code Online (Sandbox Code Playgroud)

ssl openssl curl centos5

3
推荐指数
1
解决办法
7402
查看次数

如何在 curl 中使用 rootcert.pem 证书?

我有一个格式为rootcert.pem的文件/证书。如何将此证书与 curl 一起使用?

certificate curl

3
推荐指数
1
解决办法
2万
查看次数

通过中间服务器卷曲

我需要通过自定义端口从 client1 到 server2 发送带有 curl 的 PUT/GET/POST 请求。但是,server2 只接受来自 server1 的这些请求,如果直接连接,则拒绝 client1。通过 server1 将 curl 请求从 client1 隧道传输到 server2 的最佳方法是什么。

例如,在 SSH 的情况下,我通过创建隧道来做到这一点。所以我想知道 curl 是否存在类似的功能。

tunneling curl

3
推荐指数
2
解决办法
8846
查看次数