当前位置:网站首页>.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还是要谨慎使用
边栏推荐
- How can I check the DOI number of a foreign document?
- Bus消息总线
- 如何给目标机器人建模并仿真【数学/控制意义】
- Data of all class a scenic spots in China in 2022 (13604)
- Distributed ID solution
- DHCP路由器工作原理
- 请教一个问题,flink oracle cdc,读取一个没有更新操作的表,隔十几秒就重复读取全量数据
- Abnova 膜蛋白脂蛋白体技术及类别展示
- 2022 Android interview essential knowledge points, a comprehensive summary
- 一文带你了解静态路由的特点、目的及配置基本功能示例
猜你喜欢

Apache ab 压力测试

Can 7-day zero foundation prove HCIA? Huawei certification system learning path sharing

Redis (I) -- getting to know redis for the first time

dolphinscheduler3. X local startup

How to install swoole under window

This article introduces you to the characteristics, purposes and basic function examples of static routing

服装门店如何盈利?

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

Learning notes | data Xiaobai uses dataease to make a large data screen

学术报告系列(六) - Autonomous Driving on the journey to full autonomy
随机推荐
JWT 认证
Google Chrome browser released patch 103.0.5060.114 to fix the 0-day vulnerability
Redis (I) -- getting to know redis for the first time
RuntimeError: CUDA error: CUBLAS_STATUS_ALLOC_FAILED when calling `cublasCreate(handle)`问题解决
Under what circumstances should we consider sub database and sub table
大咖云集|NextArch基金会云开发Meetup来啦
从零到一,教你搭建「CLIP 以文搜图」搜索服务(二):5 分钟实现原型
POI export to excel: set font, color, row height adaptation, column width adaptation, lock cells, merge cells
SolidWorks的GB库(钢型材库,包括铝型材、铝管等结构)安装及使用教程(生成铝型材为例)
算法---比特位计数(Kotlin)
关于数据库数据转移的问题,求各位解答下
健身房如何提高竞争力?
What books can greatly improve programming ideas and abilities?
MYSQL----导入导出&视图&索引&执行计划
联合索引ABC的几种索引利用情况
ESXI挂载移动(机械)硬盘详细教程
Force deduction 62 different paths (the number of all paths from the upper left to the lower right of the matrix) (dynamic planning)
Abnova 免疫组化服务解决方案
2022 Android interview essential knowledge points, a comprehensive summary
2022/07/04学习记录