kaisellgren / mailer

Compose and send emails from Dart. Supports file attachments, HTML emails and multiple transport methods.
MIT License
166 stars 86 forks source link

HandshakeException on send() <= API 24 #210

Closed rubenferreira97 closed 1 year ago

rubenferreira97 commented 2 years ago

Running flutter 3.0.1. When send() is called, on older Android APIs <= 24 a HandshakeException is throw.

HandshakeException (HandshakeException: Handshake error in client (OS Error: 
    CERTIFICATE_VERIFY_FAILED: certificate has expired(handshake.cc:393)))

Exception Line:

@pragma("vm:external-name", "SecureSocket_Handshake")
external int _handshake(SendPort replyPort);
close2 commented 2 years ago

What happens if you enable the option: ignoreBadCertificate on an StmpServer instance?

SmtpServer gmail(String username, String password) =>
    SmtpServer('smtp.gmail.com', username: username, password: password, ignoreBadCertificate: true);