当前位置:网站首页>.net 5 FluentFTP连接FTP失败问题:This operation is only allowed using a successfully authenticated context
.net 5 FluentFTP连接FTP失败问题:This operation is only allowed using a successfully authenticated context
2022-07-07 02:49:00 【平山CP3】
背景:测试环境下用FluentFTP连接FTP没问题,到客户那里连接不上了
问题分析:
1.看错误信息,是认证之类的,检查了FTP账号密码是没问题的
2.检查客户那边的FTP Server,是Sery-U搭建的,用客户端连接是可以的
3.那就是程序问题,怀疑是FluentFTP问题,但查看FluentFTP,是支持连接Serv-U的;因为不想更改程序内过多东西,于是开始分析FluentFTP使用问题
4.查看了初始化FTPClient方法,尝试更换后,无效;发现连接处是使用的AutoConnect,感觉好像坏在这个Auto上了
看一下AutoConnect作用:

这补了个小知识,FTPS是在FTP基础上需要TLS和SSL认证的,但是和基于SSH的FTP是不一样的(即SFTP)。那AutoConnect应该就是自动识别是FTP还是FTPS,然后进行连接。这里它应该认为是FTPS,然后去连接,同时我们的连接信息中缺少对于FTPS连接认证的凭据,导致不成功;
解决:将AutoConnect改为Connect就好了;
延申:
反编译查看了一下AutoConnect的源码:

他是获取多个FtpProfile,并取第一个进行连接;
查看AutoDetect方法中,明显有很多关于SSL的操作,但是没确定是哪块操作导致这个错误
总结:对于AutoConnect和Connect还是要谨慎使用
边栏推荐
- This article introduces you to the characteristics, purposes and basic function examples of static routing
- Problems and precautions about using data pumps (expdp, impdp) to export and import large capacity tables in Oracle migration
- [solution] final app status- undefined, exitcode- 16
- 偏执的非合格公司
- String (explanation)
- MySQL SQL的完整处理流程
- C interview 24 (pointer) define a double array with 20 elements a
- 反射(二)
- 数据资产管理与数据安全国内外最新趋势
- 大促过后,销量与流量兼具,是否真的高枕无忧?
猜你喜欢

MATLAB小技巧(30)非线性拟合 lsqcurefit

Can't you really do it when you are 35 years old?

Which foreign language periodicals are famous in geology?

jdbc数据库连接池使用问题

2022 Android interview essential knowledge points, a comprehensive summary

偏执的非合格公司

RuntimeError: CUDA error: CUBLAS_STATUS_ALLOC_FAILED when calling `cublasCreate(handle)`问题解决

The latest trends of data asset management and data security at home and abroad

mysql查看bin log 并恢复数据

地质学类比较有名的外文期刊有哪些?
随机推荐
根据IP获取地市
二十岁的我4面拿到字节跳动offer,至今不敢相信
Under what circumstances should we consider sub database and sub table
Abnova 免疫组化服务解决方案
网络基础 —— 报头、封装和解包
Unable to debug screen program with serial port
oracle如何备份索引
大促过后,销量与流量兼具,是否真的高枕无忧?
mysql查看bin log 并恢复数据
SolidWorks的GB库(钢型材库,包括铝型材、铝管等结构)安装及使用教程(生成铝型材为例)
Cloudcompare point pair selection
毕业设计游戏商城
unity3d学习笔记
反射(二)
Unity C# 函数笔记
隐马尔科夫模型(HMM)学习笔记
工具类:对象转map 驼峰转下划线 下划线转驼峰
JWT certification
项目实战 五 拟合直线 获得中线
jdbc数据库连接池使用问题