当前位置:网站首页>.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还是要谨慎使用
边栏推荐
- 算法---比特位计数(Kotlin)
- AddressSanitizer 技术初体验
- 2022年全国所有A级景区数据(13604条)
- from .onnxruntime_pybind11_state import * # noqa ddddocr运行报错
- Redis (I) -- getting to know redis for the first time
- 途家、木鸟、美团……民宿暑期战事将起
- SVN version management in use replacement release and connection reset
- JESD204B时钟网络
- 华为机试题素数伴侣
- Force deduction 62 different paths (the number of all paths from the upper left to the lower right of the matrix) (dynamic planning)
猜你喜欢

服装门店如何盈利?

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

The difference between string constants and string objects when allocating memory

Redhat5 installing vmware tools under virtual machine

DHCP路由器工作原理

SolidWorks GB Library (steel profile library, including aluminum profile, aluminum tube and other structures) installation and use tutorial (generating aluminum profile as an example)

Jetpack Compose 远不止是一个UI框架这么简单~

JESD204B时钟网络

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

LM small programmable controller software (based on CoDeSys) Note 23: conversion of relative coordinates of servo motor operation (stepping motor) to absolute coordinates
随机推荐
ViewModelProvider.of 过时方法解决
化工园区危化品企业安全风险智能化管控平台建设四大目标
带你刷(牛客网)C语言百题(第一天)
2022年全国所有A级景区数据(13604条)
[GNN] graphic gnn:a gender Introduction (including video)
Redhat5 installing vmware tools under virtual machine
【从零开始】win10系统部署Yolov5详细过程(CPU,无GPU)
Basic DOS commands
LVS+Keepalived(DR模式)学习笔记
Etcd database source code analysis -- starting from the start function of raftnode
BindingException 异常(报错)处理
oracle如何备份索引
unity3d学习笔记
【NOI模拟赛】区域划分(结论,构造)
C language interview to write a function to find the first public string in two strings
Mysql---- import and export & View & Index & execution plan
Cloudcompare point pair selection
Can 7-day zero foundation prove HCIA? Huawei certification system learning path sharing
DB2获取表信息异常:Caused by: com.ibm.db2.jcc.am.SqlException: [jcc][t4][1065][12306][4.25.13]
js装饰器@decorator学习笔记