当前位置:网站首页>.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还是要谨慎使用
边栏推荐
- C language interview to write a function to find the first occurrence of substring m in string n.
- jdbc数据库连接池使用问题
- Problems and precautions about using data pumps (expdp, impdp) to export and import large capacity tables in Oracle migration
- Force deduction 62 different paths (the number of all paths from the upper left to the lower right of the matrix) (dynamic planning)
- 反射(二)
- 请问如何查一篇外文文献的DOI号?
- 大咖云集|NextArch基金会云开发Meetup来啦
- The latest trends of data asset management and data security at home and abroad
- [GNN] graphic gnn:a gender Introduction (including video)
- 从零到一,教你搭建「CLIP 以文搜图」搜索服务(二):5 分钟实现原型
猜你喜欢
剑指offer-高质量的代码
Navicat importing 15g data reports an error [2013 - lost connection to MySQL server during query] [1153: got a packet bigger]
当前发布的SKU(销售规格)信息中包含疑似与宝贝无关的字
Data of all class a scenic spots in China in 2022 (13604)
Jetpack Compose 远不止是一个UI框架这么简单~
Leetcode T1165: 日志分析
Abnova 膜蛋白脂蛋白体技术及类别展示
反射(二)
项目实战 五 拟合直线 获得中线
毕业设计游戏商城
随机推荐
LM small programmable controller software (based on CoDeSys) Note 23: conversion of relative coordinates of servo motor operation (stepping motor) to absolute coordinates
impdp的transform参数的测试
企业如何进行数据治理?分享数据治理4个方面的经验总结
关于数据库数据转移的问题,求各位解答下
Postgresql源码(60)事务系统总结
A program lets you understand what static inner classes, local inner classes, and anonymous inner classes are
化工园区危化品企业安全风险智能化管控平台建设四大目标
MySQL卸载文档-Windows版
Can't you really do it when you are 35 years old?
Learning notes | data Xiaobai uses dataease to make a large data screen
Jetpack Compose 远不止是一个UI框架这么简单~
C language interview to write a function to find the first public string in two strings
Tkinter window selects PCD file and displays point cloud (open3d)
MOS tube parameters μ A method of Cox
请教一下,监听pgsql ,怎样可以监听多个schema和table
JESD204B时钟网络
dolphinscheduler3. X local startup
MYSQL----导入导出&视图&索引&执行计划
快速定量,Abbkine 蛋白质定量试剂盒BCA法来了!
[GNN] graphic gnn:a gender Introduction (including video)