.NET Get the current connection

Advertisement

KMMike
Guest

.NET Get the current connection

After I open a connection with the .NET/WinSCP-Lib I will see, the current connection info. How can I do it to see, which protocol, if TLS is used and so on.

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,441
Location:
Prague, Czechia

Re: .NET Get the current connection

When you open a session with the WinSCP .NET assembly, you know what protocol did you ask it to use, don't you?

Reply with quote

Guest

Re: .NET Get the current connection

Yes - but i will know if my session is correct set.

Look, my code is:
With FTPCon
    .Protocol = Protocol.Ftp
    .HostName = FtpServer.ServerAdress
    .UserName = FtpServer.UserName
    .Password = FtpServer.Password
    .PortNumber = FtpServer.Port
    .FtpSecure = FtpSecure.Explicit
    .GiveUpSecurityAndAcceptAnyTlsHostCertificate = True
End With
But I will know, if TLS1.3 is used.

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
41,441
Location:
Prague, Czechia

Re: .NET Get the current connection

Finding out what version of TLC is used is very different problem than what you have asked originally. You can find that in the session log only.
But instead, you can make WinSCP not allow older versions of TLS:
FTPCon.AddRawSettings("MinTlsVersion", "13")
But if you want a secure connection, you cannot set GiveUpSecurityAndAcceptAnyTlsHostCertificate = True in the first place!

Reply with quote

Advertisement

You can post new topics in this forum