cURL "Ошибка чтения ответа" при передаче файла FTPS

3893
user35581

Я пытаюсь загрузить каталог и его файлы, используя cURL через FTPS.

Следующая команда очень близко подходит ко мне - я успешно вошел в систему и установил канал очистки команды, но затем он не работает с curl: (56) response reading failed

curl -v --ftp-ssl --data-ascii --ftp-pasv --no-epsv --user myusername:XXXXXXXX ftp://ftp.server.com:21 -Q "CCC" * About to connect() to ftp.server.com port 21 (#0)* Trying 55.55.55.55... connected < 220-This System Is For Authorized Users Only. < 220- < 220 Secure FTP Server - SecureTransport ready. > AUTH SSL < 234 SSLv23/TLSv1 * successfully set certificate verify locations: * CAfile: none CApath: /etc/ssl/certs * SSLv3, TLS handshake, Client hello (1): * SSLv3, TLS handshake, Server hello (2): * SSLv3, TLS handshake, CERT (11): * SSLv3, TLS handshake, Server finished (14): * SSLv3, TLS handshake, Client key exchange (16): * SSLv3, TLS change cipher, Client hello (1): * SSLv3, TLS handshake, Finished (20): * SSLv3, TLS change cipher, Client hello (1): * SSLv3, TLS handshake, Finished (20): * SSL connection using AES256-SHA * Server certificate: * subject: DC=local; DC=ftp_host_company; DC=us; OU=Accounts; OU=SSL Accounts; CN=ftp.server.com * start date: 2012-02-14 16:29:37 GMT * expire date: 2015-02-14 16:59:37 GMT * common name: ftp.server.com (matched) * issuer: DC=local; DC=ftp_host_company; CN=Configuration; CN=Services; CN=Public Key Services; CN=AIA; CN=FTP_hosting_company Issuing CA 1 * SSL certificate verify ok. > USER myusername < 331 Password required for myusername. > PASS XXXXXXXX < 230 Virtual user myusername logged in. > PBSZ 0 < 200 PBSZ=0 > PROT P < 200 PROT command successful > PWD < 257 "/" is current directory. * Entry path is '/' > CCC < 200 command channel cleared. > PASV * Connect data stream passively * SSLv3, TLS alert, Client hello (1): * response reading failed * Closing connection #0 * SSLv3, TLS alert, Client hello (1): curl: (56) response reading failed 

Хост ftps специально сказал, что мне нужно будет подключиться к FTPS через Clear Command Channel на порт 21 - что-то мне не хватает?

0

1 ответ на вопрос

1
Steffen Ullrich

CCC is used to downgrade the command channel back from SSL to plain text, that is after the successful response to CCC is received both sides must do a SSL_shutdown on the socket. Thus curl must deal with this inherent semantic of the command and it is not sufficient to let curl just send this command like it would do with any other arbitrary command. Instead you have to use the --ftp-ssl-ccc option.

добавив опцию --ftp-ssl-ccc Dejel 9 лет назад 0
@Odelya: «добавление опции --ftp-ssl-ccc» - не работает, выдает сообщения об ошибках, такой опции нет ..... Пожалуйста, дайте подробное сообщение об ошибке, если вам нужна помощь. Если вы продолжите добавлять только небольшие фрагменты проблемы, я буду игнорировать будущие комментарии. Steffen Ullrich 9 лет назад 1

Похожие вопросы