当前位置:网站首页>.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还是要谨慎使用
边栏推荐
- Data of all class a scenic spots in China in 2022 (13604)
- SolidWorks的GB库(钢型材库,包括铝型材、铝管等结构)安装及使用教程(生成铝型材为例)
- 【解决】Final app status- UNDEFINED, exitCode- 16
- 【NOI模拟赛】区域划分(结论,构造)
- MySql用户权限
- [start from scratch] detailed process of deploying yolov5 in win10 system (CPU, no GPU)
- 快速定量,Abbkine 蛋白质定量试剂盒BCA法来了!
- Leite smart home longhaiqi: from professional dimming to full house intelligence, 20 years of focus on professional achievements
- Distributed ID solution
- FPGA课程:JESD204B的应用场景(干货分享)
猜你喜欢

精准时空行程流调系统—基于UWB超高精度定位系统

How to install swoole under window

网络基础 —— 报头、封装和解包

场馆怎么做体育培训?

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

循环肿瘤细胞——Abnova 解决方案来啦

Cloudcompare point pair selection

Leite smart home longhaiqi: from professional dimming to full house intelligence, 20 years of focus on professional achievements

软件测试到了35岁,真的就干不动了吗?

MATLAB小技巧(30)非线性拟合 lsqcurefit
随机推荐
Networkx绘图和常用库函数坐标绘图
一文带你了解静态路由的特点、目的及配置基本功能示例
Jmeter 5.5版本发布说明
Stack and queue-p79-9
地质学类比较有名的外文期刊有哪些?
MySQL卸载文档-Windows版
Learning notes | data Xiaobai uses dataease to make a large data screen
Abnova 膜蛋白脂蛋白体技术及类别展示
Which foreign language periodicals are famous in geology?
Force deduction 62 different paths (the number of all paths from the upper left to the lower right of the matrix) (dynamic planning)
Abnova循环肿瘤DNA丨全血分离,基因组DNA萃取分析
[solution] final app status- undefined, exitcode- 16
「运维有小邓」符合GDPR的合规要求
Comment les entreprises gèrent - elles les données? Partager les leçons tirées des quatre aspects de la gouvernance des données
使用TCP/IP四层模型进行网络传输的基本流程
MySql用户权限
The latest trends of data asset management and data security at home and abroad
Programmers' daily | daily anecdotes
学习笔记|数据小白使用DataEase制作数据大屏
Install mongodb database