当前位置:网站首页>.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还是要谨慎使用
边栏推荐
- Take you to brush (niuke.com) C language hundred questions (the first day)
- Jmeter 5.5版本发布说明
- DHCP路由器工作原理
- Abnova 体外转录 mRNA工作流程和加帽方法介绍
- Stack and queue-p79-9
- C language interview to write a function to find the first public string in two strings
- JWT certification
- 项目实战 五 拟合直线 获得中线
- 企業如何進行數據治理?分享數據治理4個方面的經驗總結
- ANR 原理及实践
猜你喜欢

MySQL卸载文档-Windows版

Go straight to the 2022ecdc fluorite cloud Developer Conference: work with thousands of industries to accelerate intelligent upgrading

Etcd database source code analysis -- starting from the start function of raftnode
![[opencv] morphological filtering (2): open operation, morphological gradient, top hat, black hat](/img/45/f3b960e3c56f50674b0e6374cba705.png)
[opencv] morphological filtering (2): open operation, morphological gradient, top hat, black hat

Abnova 免疫组化服务解决方案

Programmers' daily | daily anecdotes

MOS tube parameters μ A method of Cox

场馆怎么做体育培训?

大促过后,销量与流量兼具,是否真的高枕无忧?

Abnova 体外转录 mRNA工作流程和加帽方法介绍
随机推荐
MySql用户权限
健身房如何提高竞争力?
【NOI模拟赛】区域划分(结论,构造)
Redis (II) - redis General Command
ESXI挂载移动(机械)硬盘详细教程
[start from scratch] detailed process of deploying yolov5 in win10 system (CPU, no GPU)
linux系统rpm方式安装的mysql启动失败
Take you to brush (niuke.com) C language hundred questions (the first day)
unity3d学习笔记
一文带你了解静态路由的特点、目的及配置基本功能示例
Can 7-day zero foundation prove HCIA? Huawei certification system learning path sharing
Programmers' daily | daily anecdotes
js装饰器@decorator学习笔记
Performance comparison between Ceres solver and g2o
如何给目标机器人建模并仿真【数学/控制意义】
分布式id解决方案
大促过后,销量与流量兼具,是否真的高枕无忧?
Redhat5 installing vmware tools under virtual machine
Basic DOS commands
Install mongodb database