【问题标题】:curl: Accessing a TLS secured FTP server through a proxycurl:通过代理访问 TLS 安全的 FTP 服务器
【发布时间】:2021-08-20 10:00:54
【问题描述】:

我正在尝试通过代理连接到需要 TLS1.2 的 FTP 服务器。

我从 FTP 服务器收到一条错误消息(如下所示),因此连接本身已建立。 但是,如果我尝试在没有 TLS1.2 的情况下进行连接,则会遇到同样的错误,因此代理似乎没有使用 TLS1.2 连接到 FTP 服务器。

我需要怎么做才能让 curl “告诉”代理使用 TLS1.2?

这里是连接的参数和日志。

$ curl -v --tlsv1.2 -x http://login:password@mycompanyproxy.com:8080 --user-agent 'Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3 (FM Scene 4.6.1)' ftp://login2:password2@ftp.tls.needed.ftpserver.com/
* About to connect() to proxy mycompanyproxy.com port 8080 (#0)
*   Trying 1.2.3.4...
* Connected to mycompanyproxy.com (1.2.3.4) port 8080 (#0)
* Proxy auth using Basic with user 'login'
* Server auth using Basic with user 'login2'
> GET ftp://login2:password2@ftp.tls.needed.ftpserver.com/ HTTP/1.1
> Proxy-Authorization: Basic U1ZDLURFLUlQUy1XU1VTOlNhcHBoaXJlMQ==
> Authorization: Basic Z2VoZS1tcGZyOnRRenNjd0pxdzlISA==
> User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3 (FM Scene 4.6.1)
> Host: ftp.tls.needed.ftpserver.com:21
> Accept: */*
> Proxy-Connection: Keep-Alive
>
< HTTP/1.1 401 Unauthorized
* Authentication problem. Ignoring this.
< WWW-Authenticate: Basic realm="ftp.tls.needed.ftpserver.com"
< Content-Type: text/plain
< Content-Length: 157
< Cache-Control: proxy-revalidate
< Proxy-Connection: Keep-Alive
< Connection: Keep-Alive
< X-BlueCoat-Authorization: 77988e24a55a2c1a=2EBFE78A00000002od75S6szNgteRTcwOqtLwkNggTT7RwAAAgAAAF/6EwOEAwAAAAAAAIOqMQAAAAAA
< Proxy-support: Session-based-authentication
< Date: Tue, 01 Jun 2021 13:04:57 GMT
<
Security Notice
You are about to access a secured resource. ftp.tls.needed.ftpserver.com
reserves the right to monitor and/or limit access to this resource at
* Connection #0 to host mycompanyproxy.com left intact

提前致谢

【问题讨论】:

    标签: ssl curl proxy ftp


    【解决方案1】:

    curl 中给出的任何--tls* 设置仅与 curl 自身发起的连接相关。通过代理进行 ftp 访问,到 FTP 服务器的连接是由代理完成的,而不是 curl。这意味着 --tls* 参数没有帮助。

    我需要怎么做才能让 curl “告诉”代理使用 TLS1.2?

    无法指示代理对 FTP 服务器使用特定的 TLS 版本。根本无法指示代理对 FTP 服务器使用 TLS。代理所知道的只是它应该连接到ftp://... URL。这不是特定于 curl 的,而是 HTTP 代理的工作原理。

    但这是同样的错误......

    根本没有显示错误。输出仅显示来自 FTP 服务器的通知,即 FTP 服务器发送的常见欢迎消息。您似乎没有在 URL 中指定要检索的任何文件。所以它所做的只是连接到 FTP 服务器,但不从中检索任何内容。

    【讨论】:

      猜你喜欢
      • 2016-01-06
      • 1970-01-01
      • 2014-10-29
      • 1970-01-01
      • 2017-02-20
      • 1970-01-01
      • 1970-01-01
      • 2010-10-19
      • 1970-01-01
      相关资源
      最近更新 更多