2017-05-05 136 views
1

我有一個場景,我需要上傳文件到遠程FTP服務器。從中我試圖上傳該文件本機是一種AWS-VPC內和SOCKS服務器後面,我現在用以下命令這樣做無法上傳文件到遠程FTP服務器

curl --connect-timeout 90 -T nishant.txt ftps://ftp.box.com/RANDOM_FOLDER/nishants.txt --user "username:password" -x socks://internal-proxy-elb-7288384.eu-central-1.elb.amazonaws.com:1080 -v 

現在,當我運行它,它建立的連接並將文件也發送到遠程FTP服務器,但上傳到遠程服務器的文件爲

我收到運行上述文件中的錯誤是:

> STOR nishants.txt 
< 150 File status okay; about to open data connection. 
* Doing the SSL/TLS handshake on the data stream 
* successfully set certificate verify locations: 
* CAfile: none 
    CApath: /etc/ssl/certs 
* SSL re-using session ID 
* SSLv3, TLS handshake, Client hello (1): 
} [data not shown] 
* SSLv3, TLS alert, Client hello (1): 
{ [data not shown] 
* Unknown SSL protocol error in connection to ftp.box.com:990 
    0  0 0  0 0  0  0  0 --:--:-- 0:00:04 --:--:--  0 
* Closing connection 0 
* SSLv3, TLS alert, Client hello (1): 
} [data not shown] 
curl: (35) Unknown SSL protocol error in connection to ftp.box.com:990 

我正在下面捲曲版本:

curl 7.35.0 (x86_64-pc-linux-gnu) libcurl/7.35.0 OpenSSL/1.0.1f zlib/1.2.8 libidn/1.28 librtmp/2.3 

OpenSSL的版本:

OpenSSL 1.0.1f 6 Jan 2014 

回答

0

這通常發生當您嘗試連接的服務器不喜歡協議或密碼時。

  1. 嘗試使用SSLV2

    curl --sslv2 --connect-timeout 90 -T nishant.txt ftps://ftp.box.com/RANDOM_FOLDER/nishants.txt --user "username:password" -x socks://internal-proxy-elb-7288384.eu-central-1.elb.amazonaws.com:1080 -v
  2. 你可能會嘗試連接到使用SSL密碼,該網站被配置爲reject.Try使用curl與--ciphers ALL選項的網站。另外,嘗試檢測一個OpenSSL的連接

    openssl s_client -connect ftp.box.com:990
    openssl s_client -connect ftp.box.com:990 -ssl3
  3. 上述命令的結果也可以表明這是否與捲曲或不存在錯誤。您可以嘗試將curl降級到7.33.0-3。

編輯1

我測試用openssl命令遠程站點。看來SSL2/3不受支持。您需要使用密碼DES-CBC3-SHA使用TLSv1。

試試這個

curl -1 --connect-timeout 90 -T nishant.txt ftps://ftp.box.com/RANDOM_FOLDER/nishants.txt --user "username:password" -x socks://internal-proxy-elb-7288384.eu-central-1.elb.amazonaws.com:1080 -v

如果您收到同樣的錯誤信息,試着用以上選項--ciphers提到的密碼。

+0

當我嘗試選項1時,它表示* OpenSSL內置了SSLv2支持*,並且當我嘗試選項2時,它只是退出 –

+0

編輯答案。它似乎服務器使用TLSv1 – agent420

+0

所以我得到了同樣的錯誤,我有一種感覺與https://curl.haxx.se/docs/knownbugs.html#FTPS_over_SOCKS –

相關問題