javanile / php-imap2

PHP IMAP with OAUTH2
https://php-imap2.javanile.org/
GNU General Public License v3.0
48 stars 28 forks source link

Implement /novalidate-cert flag #58

Closed williamdes closed 1 month ago

williamdes commented 10 months ago

The workaround, change in: src/Connection.php

        $success = $client->connect($this->host, $this->user, $this->password, array_merge($this->options, [
            'port' => $this->port,
            'ssl_mode' => $this->sslMode,
            'auth_type' => $this->flags & OP_XOAUTH2 ? 'XOAUTH2' : 'CHECK',
            'timeout' => -1,
            'force_caps' => false,
        ]));

And then:

        $mbox = imap2_open(
            '{mail-server.mail.williamdes.eu.org:993/ssl/novalidate-cert}',
            'john@mail.williamdes.eu.org',
            'JohnPassWord!645987zefdm',
            0,
            0,
            [
                'socket_options' => [ 'ssl' => ['verify_peer' => false]],
            ]
        );