From a409e1fd441eab4ff57edf2e618b3aeda4a2acde Mon Sep 17 00:00:00 2001 From: Developer01 Date: Thu, 26 Jun 2025 17:14:08 +0200 Subject: [PATCH] Messaging TLS Protokoll --- Messaging/Mail/MailSession.vb | 7 ++++--- Messaging/My Project/AssemblyInfo.vb | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Messaging/Mail/MailSession.vb b/Messaging/Mail/MailSession.vb index 342cb93c..814cd9be 100644 --- a/Messaging/Mail/MailSession.vb +++ b/Messaging/Mail/MailSession.vb @@ -19,6 +19,7 @@ Namespace Mail Public Const AUTH_SSLTLS = "SSL/TLS" Public Const AUTH_NONE = "NONE" Public Const AUTH_OAUTH2 = "OAUTH2" + Public Const SSLProtocol_TLS12 = "TLS12" Private Const SMTP_IGNORED_ERRORS As SslPolicyErrors = SslPolicyErrors.RemoteCertificateChainErrors Or ' self-signed @@ -137,10 +138,8 @@ Namespace Mail If pOptions.EnableTls1_2 Then Logger.Debug("Enabling TLS Version 1.2...") - Client.SSLConfiguration.EnabledSslProtocols = Client.SSLConfiguration.EnabledSslProtocols Or Security.Authentication.SslProtocols.Tls12 + Client.SSLConfiguration.EnabledSslProtocols = Security.Authentication.SslProtocols.Tls12 End If - - ' This is not available in .NET 4.6.2, only in .NET 4.7/4.8 'If pOptions.EnableTls1_3 Then ' Logger.Debug("Enabling TLS Version 1.3") ' oSession.SSLConfiguration.EnabledSslProtocols = oSession.SSLConfiguration.EnabledSslProtocols Or Security.Authentication.SslProtocols.Tls13 @@ -192,7 +191,9 @@ Namespace Mail ElseIf Session.AuthType = AUTH_SSLTLS Or Session.AuthType = AUTH_STARTTLS Then Try + Logger.Debug("Client.SSLConfiguration.EnabledSslProtocols is [{0}]", Client.SSLConfiguration.EnabledSslProtocols.ToString) If pSession.Port = 993 Then + Logger.Debug("Port is 993 - So Client.ConnectSSL will be used!") Logger.Debug("Connecting with [STARTTLS/ConnectSSL] on [{0}/{1}]", pSession.Server, pSession.Port) Client.ConnectSSL(pSession.Server, pSession.Port) Else diff --git a/Messaging/My Project/AssemblyInfo.vb b/Messaging/My Project/AssemblyInfo.vb index 97f93681..df394fb7 100644 --- a/Messaging/My Project/AssemblyInfo.vb +++ b/Messaging/My Project/AssemblyInfo.vb @@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices ' übernehmen, indem Sie "*" eingeben: ' - - + +