POP3 Connection with TLS v1.2 don't work

0 votes
asked Mar 11 by gianluca.monte (120 points)

I am using the 2018 R2. to connect to a server that only allows TLS 1.2, but the connection fails with an Timeout error.

I use this code for VB.NET

Dim client As New Pop3
client.Connect("testtls.pec.rupar.puglia.it", 995)

Can you help me

Thank you

1 Answer

0 votes
answered Mar 11 by Lukas Matyska (54,470 points)

For Pop3 class, the default TLS/SSL mode is SslMode.None. If you want to use TLS 1.2, please specify SslMode explicitly like this:

client.Connect("testtls.pec.rupar.puglia.it", 995, SslMode.Implicit)

Since the port 995 is default for implicit SSL/TLS, you can also use this call:

client.Connect("testtls.pec.rupar.puglia.it", SslMode.Implicit)
commented Mar 12 by gianluca.monte (120 points)
Hi,
connection with sslmode.Implicit is ok, but when I tried to authenticate I have "Unknow Error" :

client.Connect("testtls.pec.rupar.puglia.it", SslMode.Implicit)
client.Login("***", "***")

Rebex.Net.Pop3Exception non è stata gestita
  HResult=-2146233088
  Message=Unknown error.
  Source=Rebex.Pop3
  StackTrace:
       in Rebex.Net.Pop3.ewzt(Boolean bg, Boolean bh, String& bi)
       in Rebex.Net.Pop3.ewzo(String aw, Boolean ax, Boolean ay)
       in Rebex.Net.Pop3.exaj(String ch, String ci, Pop3Authentication cj, GssApiProvider ck)
       in Rebex.Net.Pop3.exat(String cv, String cw, Pop3Authentication cx)
       in Rebex.Net.Pop3.Login(String userName, String password, Pop3Authentication method)
       in Rebex.Net.Pop3.Login(String userName, String password)
       in TestTLSv1._2.Form1.ButtonRead_Click(Object sender, EventArgs e) in C:\Users\monteg\AppData\Local\Temporary Projects\TestTLSv1.2\Form1.vb:riga 24
       in System.Windows.Forms.Control.OnClick(EventArgs e)
       in System.Windows.Forms.Button.OnClick(EventArgs e)
       in System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
       in System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
       in System.Windows.Forms.Control.WndProc(Message& m)
       in System.Windows.Forms.ButtonBase.WndProc(Message& m)
       in System.Windows.Forms.Button.WndProc(Message& m)
       in System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
       in System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
       in System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
       in System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
       in System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
       in System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
       in System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
       in Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
       in Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
       in Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)
       in TestTLSv1._2.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:riga 81
       in System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
       in System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
       in Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       in System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       in System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       in System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       in System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       in System.Threading.ThreadHelper.ThreadStart()
  InnerException:


Can you help me

Thank you
commented Mar 12 by Lukas Matyska (54,470 points)
It seems that your server has broken APOP extension.

Please disable it like this:

  client.Settings.DisableApopAuthentication = true
  client.Connect(...)
  client.Login(...)
commented Mar 13 by gianluca.monte (120 points)
It seems work fine.

Thank you.
...