IMAP - Unknown: TLS/SSL failure for mail.domain.tld: SSL negotiation failed (errflg=2)

Probably the SSL certificate has expired.

Work-arround without SSL:

imap_open("{mail.domain.tld:143/imap/notls}INBOX", $username, $password);

Work-arround with SSL:

imap_open("{mail.domain.tld:993/imap/ssl/novalidate-cert}INBOX", $username, $password);