0

This is the error log, and i have no idea how to solve this.

[Thu Jan 25 10:39:42.689306 2018] [:error] [pid 21084] PHP Warning: fgets(): SSL operation failed with code 1. OpenSSL Error messages:
error:06065064:digital envelope routines:EVP_DecryptFinal_ex:bad decrypt
error:06065064:digital envelope routines:EVP_DecryptFinal_ex:bad decrypt
error:06065064:digital envelope routines:EVP_DecryptFinal_ex:bad decrypt
error:06065064:digital envelope routines:EVP_DecryptFinal_ex:bad decrypt in ../vendor/pear-pear.horde.org/Horde_Imap_Client/Horde/Imap/Client/Socket/Connection/Socket.php on line 156

public function read($size = null)
{
    $got_data = false;
    $literal_len = null;
    $token = new Horde_Imap_Client_Tokenize();

    do {
        if (feof($this->_stream)) {
            $this->close();
            $this->_params['debug']->info(
                'ERROR: Server closed the connection.'
            );
            throw new Horde_Imap_Client_Exception(
                Horde_Imap_Client_Translation::r("Mail server closed the connection unexpectedly."),
                Horde_Imap_Client_Exception::DISCONNECT
            );
        }

        if (is_null($literal_len)) {
            $buffer = '';

            while (($in = fgets($this->_stream)) !== false) {
                $got_data = true;

                if (substr($in, -1) === "\n") {
                    $in = rtrim($in);
                    $this->_params['debug']->server($buffer . $in);
                    $token->add($in);
                    break;
                }

                $buffer .= $in;
                $token->add($in);
            }

            /* Check for literal data. */
            if (is_null($len = $token->getLiteralLength())) {
                break;
            }

            // Skip 0-length literal data.
            if ($len['length']) {
                $binary = $len['binary'];
                $literal_len = $len['length'];
            }

            continue;
        }

        $old_len = $literal_len;

        while (($literal_len > 0) && !feof($this->_stream)) {
            $in = fread($this->_stream, min($literal_len, 8192));
            /* Only store in stream if this is something more than a
             * nominal number of bytes. */
            if ($old_len > 256) {
                $token->addLiteralStream($in);
            } else {
                $token->add($in);
            }

            if (!empty($this->_params['debugliteral'])) {
                $this->_params['debug']->raw($in);
            }

            $got_data = true;
            $literal_len -= strlen($in);
        }

        $literal_len = null;

        if (empty($this->_params['debugliteral'])) {
            $this->_params['debug']->server('[' . ($binary ? 'BINARY' : 'LITERAL') . ' DATA: ' . $old_len . ' bytes]');
        }
    } while (true);

    if (!$got_data) {
        $this->_params['debug']->info('ERROR: read/timeout error.');
        throw new Horde_Imap_Client_Exception(
            Horde_Imap_Client_Translation::r("Error when communicating with the mail server."),
            Horde_Imap_Client_Exception::SERVER_READERROR
        );
    }

    return $token;
}

The error appears at

while (($in = fgets($this->_stream)) !== false) {

I have another Instance of my application on the same server with the same settings just different database and domain name.

The other Instance seems to work just fine without having problems with this error.

Note: Horde is a kind of PHP library for sending Emails.

Can anyone help me?

Álvaro González
  • 142,137
  • 41
  • 261
  • 360
Neo Morina
  • 391
  • 2
  • 13
  • If this is a programming question you should share more information than just the error log. The bare minimum I can think: some code, stream wrapper and URI protocol. If you're just a Horde user and this is a support question then I'm afraid you've come to the wrong forum. – Álvaro González Jan 25 '18 at 11:46
  • I added some more information about the occurrence of the error. – Neo Morina Jan 25 '18 at 11:55

1 Answers1

-1

Please try to change your setting as below:

<?php
    $yourArrayOptions=array(
    "ssl"=>array(
    "verify_peer"=>false,
    "verify_peer_name"=>false,
 ),
)
$response = file_get_contents("fileName", false, 
stream_context_create($yourArrayOptions));
echo $response; ?>

please click here for better explanation file_get_contents(): SSL operation failed with code 1. And more

conbask
  • 9,741
  • 16
  • 57
  • 94