Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add property in FtpClient class to retrieve the selected SslProtocol #916

Closed
JosHuybrighs opened this issue Aug 19, 2022 · 13 comments
Closed

Comments

@JosHuybrighs
Copy link

FTP OS: All

FTP Server: All

Computer OS: All

FluentFTP Version: Future release

Framework: All

Could it be possible for one of the next updates of FluentFTP to have the possibility to retrieve the selected/negotiated Ssl/Tls version?

I did it myself by adding the FluentFtp source code project to my solution. It is quite easy. The following files need to be expanded with a simple property:

In FtpClientProperties.cs

/// <summary>
/// The negotiated SSL/TLS version
/// </summary>
public SslProtocols SelectedSslProtocol
{
	get { return m_stream != null ? m_stream.SelectedSslProtocol : SslProtocols.None; }
}

In FtpSocketStream.cs

/// <summary>
/// The negotiated SSL/TLS version
/// </summary>
public SslProtocols SelectedSslProtocol
{
	get { return IsEncrypted ? m_sslStream.SslProtocol : SslProtocols.None; }
}

I would like to have this to inform the user about which protocol has been negotiated.

@FanDjango
Copy link
Collaborator

I would also use this.

@robinrodricks
Copy link
Owner

Good idea!

@robinrodricks
Copy link
Owner

39.4.0

  • New: Add SslProtocolActive property to retrieve the negotiated SSL/TLS protocol version

@marcwaz
Copy link

marcwaz commented Dec 16, 2024

I'm looking for the property SslProtocolActive in 52.0.0. Not here anymore ? How to retrieve the selected/negotiated Ssl/Tls version?

@FanDjango
Copy link
Collaborator

@marcwaz You are right. It disappeared by mistake after df7ac2c.

@FanDjango
Copy link
Collaborator

I have no explanation as to why it was removed. I have brought it back and committed this to the current master. It will be back in the next release.

FanDjango added a commit to FanDjango/FluentFTP that referenced this issue Dec 16, 2024
FanDjango added a commit that referenced this issue Dec 16, 2024
Bring back FtpSocketStream.SslProtocolActive (see #916)
@marcwaz
Copy link

marcwaz commented Dec 16, 2024

good. it should be tested, to ensure that it works.

@FanDjango
Copy link
Collaborator

@marcwaz Oh, thanks for offering to do that.

@marcwaz
Copy link

marcwaz commented Dec 16, 2024

Could you just send me a sample of code in order to show me how to do a call of SslProtoclActive property after a ".connect" on a new FtpClient ?

@FanDjango
Copy link
Collaborator

FanDjango commented Dec 16, 2024

				client.Connect();
				Console.WriteLine("Selected SSL Version/Protocol " + client.SslProtocolActive);

Result:

Selected SSL Version/Protocol Tls12

using the current master on GitHub.

@FanDjango
Copy link
Collaborator

FanDjango commented Dec 16, 2024

Actually more even:

				client.Connect();
				Console.WriteLine("Selected SSL Version/Protocol " + client.SslProtocolActive);
				Console.WriteLine("Selected SSL Ciphersuite " + client.SslCipherSuiteActive);

Result:

Selected SSL Version/Protocol Tls12
Selected SSL Ciphersuite Tls12 (Aes256, TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384, 44550, 255)

using the current master on GitHub.

@marcwaz
Copy link

marcwaz commented Dec 19, 2024

I don't know when the next version of FluentFTP (v52.1?) will be released.

Is it possible to push a beta nuget ?

I need the FluentFTP .net472 framework dll (compile in release mode) in order to do the tests.

I don't have the necessary environnement in order to compile the master FluentFTP sources.

thanks

@FanDjango
Copy link
Collaborator

Making a new (interim) release is solely at @robinrodricks discretion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants