当前位置:网站首页>. Net 5 fluentftp connection FTP failure problem: this operation is only allowed using a successfully authenticated context

. Net 5 fluentftp connection FTP failure problem: this operation is only allowed using a successfully authenticated context

2022-07-07 07:00:00 Pingshan CP3

background : Used in the test environment FluentFTP Connect FTP That's all right. , There is no connection to the customer

Problem analysis :

1. Look at the error message , It's certification , Checked FTP The account and password are ok

2. Check the customer FTP Server, yes Sery-U Built , It is possible to connect with the client

3. That's the procedural problem , The suspicion is FluentFTP problem , But view FluentFTP, Yes, it supports connection Serv-U Of ; Because I don't want to change too many things in the program , So I started to analyze FluentFTP Use of

4. Check the initialization FTPClient Method , After trying to replace , Invalid ; It is found that the connection is used AutoConnect, It feels like this is bad Auto Yes

to glance at AutoConnect effect :

  This makes up a little knowledge ,FTPS Is in FTP On the basis of TLS and SSL The certification , But and based on SSH Of FTP It's different ( namely SFTP). that AutoConnect It should be automatic recognition FTP still FTPS, Then connect . Here it should be considered FTPS, And then connect , At the same time, our connection information is missing for FTPS Credentials for connection authentication , Lead to failure ;

solve : take AutoConnect Change it to Connect Just fine ;

Yan Shen :

Decompile and check AutoConnect Source code :

He is getting multiple FtpProfile, And take the first one to connect ;

see AutoDetect In the method , There is obviously a lot about SSL The operation of , But I'm not sure which operation caused this error

summary : about AutoConnect and Connect Still use it cautiously

原网站

版权声明
本文为[Pingshan CP3]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/188/202207070248541828.html