简体   繁体   中英

PHP imap_open: SSL negotiation failed - only in docker

When opening an IMAP connection from PHP in a docker container, I get the following error:

imap_open(): Couldn't open stream {webmail.domain.tld}INBOX Unknown: TLS/SSL failure for webmail.domain.tld: SSL negotiation failed (errflg=2)

The exact same setup is running in a Windows VM just fine. I already tried adding any combination of ":993/imap/ssl/novalidate-cert/...", but with no luck.

I'm running the php:7.4-apache docker image and made sure that the system has the correct date and time.

Managed to solve this by switching from a Debian image, to an Alpine image. I was able to connect to some other mail servers, just not to some specific ones. My guess is combination of a badly configured mail server and a bug in either Debian or some package.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM