Aspose.Email TLS connection issues over IMAP connection


#1

I’m using Aspose Email 19.0.8 to connect to hMailServer 5.6.7-B2425 over IMAP/TLS with self signed certificate (https://www.hmailserver.com/documentation/v5.3/?page=reference_sslcertificates)

I’m able to connect to hMailServer mailbox over IMAP/TLS using Outlook but Aspose.Mail throws an exception.

System.OperationCanceledException
HResult=0x8013153B
Message=Operation has been canceled
Source=Aspose.Email
StackTrace:
at #=zHdLovjEEIod1mV72IF09M1E9Zvpw.#=zBGkfXas=(IAsyncResult #=zS9deMoU=)
at #=zHdLovjEEIod1mV72IF09M1E9Zvpw.#=zsFvFw3A=()
at #=z5f$tMCpGuWPXNsZ4baqOjm5cEK2YH2NSd_RI70U=.#=z8nYA1rQ=(#=zYRwXGXKU9cRRmCIKilOt9F_OXQBfkBaQ6w== #=zTDXZlVY=)
at #=zu$FnsJBaomaGGgGs$h2dPwP9seOK.#=zALMMRY$3NG8v(Int32 #=zioqX20U=, #=zYRwXGXKU9cRRmCIKilOt9F_OXQBfkBaQ6w== #=zJ5$sVuc=)
at #=zHdLovjEEIod1mV72IF09M1E9Zvpw.#=zr6S0mjEYND1Y()
at #=zHdLovjEEIod1mV72IF09M1E9Zvpw.#=znDtpZrs=(AsyncCallback #=z8q99aUU=, Object #=z2RXhc3k=)
at Aspose.Email.Clients.Imap.ImapClient.BeginListMessages(IConnection connection, String folderName, Int64 modificationSequence, Boolean retrieveRecursively, IEnumerable`1 messageExtraFields, AsyncCallback callback, Object state)
at Aspose.Email.Clients.Imap.ImapClient.ListMessages(String folderName)
at ConsoleApp13.Program.Main(String[] args) in …\Visual Studio 2017\Projects\ConsoleApp13\ConsoleApp13\Program.cs:line 25

Using the following code to connect

        var client = new ImapClient();
        client.Host = "127.0.0.1";
        client.Port = 993;
        client.Username = "...";
        client.Password = "...";
        client.SecurityOptions = SecurityOptions.SSLImplicit;
        client.SupportedEncryption = EncryptionProtocols.Tls12;

        var messages = client.ListMessages("Inbox");

Please advise


#2

@PatrikM,

I have observed the information shared by you. Can you please share the credentials for the test account that is reproducing issue on your end and that we may use on our end to verify the issue. Please share the requested information so that we may proceed further to help you out.


#3

I can’t see how that would possibly matter but fine by me.

The following code works just fine, IMAP over unencrypted connection

    static void Main(string[] args)
    {
        var client = new ImapClient();

        client.Host = "127.0.0.1";
        client.Port = 143;
        client.Username = "jira";
        client.Password = "jira123";
        var messages = client.ListMessages("Inbox");
    }

The following fails, only difference is the SSL certificate and TLS encryption on 993. Connecting using Outlook or other commercial e-mail clients works fine.

    static void Main(string[] args)
    {
        var client = new ImapClient();

        client.Host = "127.0.0.1";
        client.Port = 993;
        client.Username = "jira";
        client.Password = "jira123";
        client.SecurityOptions = SecurityOptions.SSLImplicit;
        client.SupportedEncryption = EncryptionProtocols.Tls12;

        var messages = client.ListMessages("Inbox");
    }

#4

certificate.zip (2.5 KB)

This is the Certificate I use if that helps, it’s self signed using OpenSSL and for development purposes only so I don’t mind sharing it publicly.


#5

@PatrikM,

Thank you for sharing the information with us. I have been able to observe the issue and a ticket with ID EMAILNET-39583 has been added in our issue tracking system to further investigate and resolve the ticket. This thread has been linked with the issue so that you may be notified once it will be addressed.