David U
David U

Reputation: 993

Authentication failure for AWS SMTP on Android 64

I have a Delphi 11 FMX app. Until recently I was using TLS 1.0 to connect to AWS SMTP. When I switched to TLS 1.2, Win32, Win64 and Android 32 continued to work correctly, but on Android 64 I am getting an error when I call Authenticate on the TIdSMTP component:

Project XXXXXXXXXXX raised exception class EIdOSSLUnderlyingCryptoError with message 'Error connecting with SSL.
error:04091068:rsa routines:INT_RSA_VERIFY:bad signature'.

Here's the code:

    aSmtp.Username := SmtpUsername;
    aSmtp.Password := SmtpPassword;
    aSmtp.Host := SmtpHost;
    try
        try
            if not aSmtp.Connected then
                aSmtp.Connect;
            aSmtp.Authenticate;
            aSmtp.Send(aEmailMsg);
        except on E: Exception do
            TUtils.Log('TViewmodelEmails.DoSendEmail error: ' + E.Message);
        end;
    finally
        if aSmtp.Connected then
            aSmtp.Disconnect;
    end;

The SMTP configuration:

  object SMTP: TIdSMTP
    IOHandler = IdSSLIOHandlerSocketOpenSSL1
    Port = 587
    SASLMechanisms = <>
    UseTLS = utUseExplicitTLS
    Left = 319
    Top = 568
  end

The IOHandler configuration:

  object IdSSLIOHandlerSocketOpenSSL1: TIdSSLIOHandlerSocketOpenSSL
    Destination = ':587'
    MaxLineAction = maException
    Port = 587
    DefaultPort = 0
    SSLOptions.Method = sslvTLSv1_2
    SSLOptions.SSLVersions = [sslvTLSv1_2]
    SSLOptions.Mode = sslmUnassigned
    SSLOptions.VerifyMode = []
    SSLOptions.VerifyDepth = 0
    Left = 199
    Top = 568
  end

I am using OpenSSL libraries supplied by EseGeCe as I am also using EseGeCe WebSockets. The WebSockets components are working successfully on Android 64 and the other platforms.

What am I doing wrong?

Thanks

Upvotes: 2

Views: 73

Answers (1)

Lutz
Lutz

Reputation: 11

Got the error, when using Android 64-bit.

I solved it by using the updated .so files from https://github.com/IndySockets/OpenSSL-Binaries/blob/master/OpenSSL%201.0.2s%20Android.zip

Upvotes: 1

Related Questions