Login  
Search All Forums
Dart Home | PowerTCP Mail for .NET | Custom Development Reply | PowerTCP Mail for .NET Topics | Forums   
AuthorForum: PowerTCP Mail for .NET
Topic: Observation on ImapConnect SSlProtocols example in documentation
kadorken

From: Baden, ON Canada
Posts: 2
Member Since: 07/23/21
posted July 23, 2021 9:31 AM

In http://dotnet.dart.com/help/ptmlnet/webframe.html#Dart.Mail~Dart.Mail.Imap~Connect.html

the example has the line
    //Optionally set the protocols available for SSL/TLS negotiation (defaults to SslProtocols.Default)
    //TLS 1.1/1.2 requires .NET 4.5+. See the SslProtocols MSDN documentation for more information.
    myImap.Session.Security.Protocols = SslProtocols.Tls | SslProtocols.Ssl3;

However, I find I must use the following to get anything except 'Tls' (1.0)

//Trying to pass Protocols.None per the MSDN documentation (https://docs.microsoft.com/en-us/dotnet/api/system.security.authentication.sslprotocols?view=net-5.0#System_Security_Authentication_SslProtocols_Default)
// is rejected by
// System.ArgumentException
// System.Net.Security.SslState.ValidateCreateContext(Boolean isServer, String targetHost, SslProtocols enabledSslProtocols, X509Certificate serverCertificate, X509CertificateCollection clientCertificates, Boolean remoteCertRequired, Boolean checkCertRevocationStatus, Boolean checkCertName)
// in .NET 4.0 at least
// Default only permits TLS 1.0 and SSL3; we need to enable the others explicitly
Protocols = System.Security.Authentication.SslProtocols.Ssl3
| System.Security.Authentication.SslProtocols.Tls11
| System.Security.Authentication.SslProtocols.Tls12
| System.Security.Authentication.SslProtocols.Tls


Not sure if you want to adjust your documentation and or code examples but I thought at least if someone else follows my trail they will find this topic.
Reply | PowerTCP Mail for .NET Topics | Forums   
This site is powered by PowerTCP WebServer Tool PowerTCP WebServer for ActiveX