Search code examples
emailhaskellmime-mail

Haskell: TLS not supported error in mime-mail-ses


I am getting "TlsNotSupported" error message when I try to use the mime-mail-ses package to send email. I read this documentation (below) that seems to specify port numbers for STARTTLS (as opposed to TLS) but neither mime-mail-ses or mime-mail seem to have a way to specify port numbers, if that in fact were a remedy to the problem.

https://docs.aws.amazon.com/ses/latest/DeveloperGuide/smtp-connect.html

ses = SES seFrom seTo seAccessKey seSecretKey seSessionToken seRegion

sMail' = simpleMail' mFrom mTo body L.empty

main = do  
  manager <- newManager defaultManagerSettings  
  renderSendMailSES manager ses sMail'

I get the following message:

Exception: HttpExceptionRequest Request {  
  ...
  port     = 443
  ...}  
TlsNotSupported

Solution

  • The issue is that defaultManagerSettings does not provide TLS support. Instead, you need to use a TLS enabled manager, such as with: