20,398
社区成员




code = curl_easy_setopt(ftp_handle, CURLOPT_URL, "ftp:127.0.0.1:990/");
code = curl_easy_setopt(ftp_handle, CURLOPT_USERNAME, "username");
code = curl_easy_setopt(ftp_handle, CURLOPT_PASSWORD, "password");
code = curl_easy_setopt(ftp_handle, CURLOPT_DIRLISTONLY, 1L);
/*
code = curl_easy_setopt(ftp_handle, CURLOPT_FTP_SSL_CCC, CURLFTPSSL_CCC_NONE);
code = curl_easy_setopt(ftp_handle, CURLOPT_SSL_VERIFYPEER, 1L);
code = curl_easy_setopt(ftp_handle, CURLOPT_SSL_VERIFYHOST, 2L);
code = curl_easy_setopt(ftp_handle, CURLOPT_FTPSSLAUTH, CURLFTPAUTH_TLS);
code = curl_easy_setopt(ftp_handle, CURLOPT_SSLVERSION, CURL_SSLVERSION_TLSv1);
*/
/*
code = curl_easy_setopt(ftp_handle, CURLOPT_TLSAUTH_TYPE, 1L);
code = curl_easy_setopt(ftp_handle, CURLOPT_TLSAUTH_USERNAME, "tms");
code = curl_easy_setopt(ftp_handle, CURLOPT_TLSAUTH_PASSWORD, "ewstms");
*/
/*
code = curl_easy_setopt(ftp_handle, CURLOPT_USE_SSL, CURLUSESSL_ALL);
*/
code = curl_easy_setopt(ftp_handle, CURLOPT_VERBOSE, 1L);
CURLcode res = curl_easy_perform(ftp_handle);
curl_easy_setopt(ftp_handle, CURLOPT_URL, "ftps://192.168.1.63");
本来昨天下班时已经打算放弃了,
但今天还是想试一下,逐步跟进源代码,发现不用FTPS的handle,
而是用的FTP的handle,于是猜测是协议写的不对,
改成上面的就可以了,蒙对了,
但其实,昨天就有人在stack overflow上给了我答案,公司登不上stack overflow,今天结贴才看到,呵呵