DevCEDTeam / CED

0 stars 0 forks source link

Error | Gmail | Plugin #78

Open DevCEDTeam opened 1 year ago

DevCEDTeam commented 1 year ago

Gmail | Plugin

DevCEDTeam commented 1 year ago

Logs | mautic_prod-2023-08-28.php

Path | /home/mautic/public_html/mautic.devced.com/var/logs/mautic_prod-2023-08-28.php

[2023-08-28 05:04:49] mautic.ERROR: [MAIL ERROR] Connection could not be established with host smtp.gmail.com :stream_socket_client(): SSL operation failed with code 1. OpenSSL Error messages: error:1408F10B:SSL routines:ssl3_get_record:wrong version number Log data: ++ Starting Swift_Transport_EsmtpTransport !! Connection could not be established with host smtp.gmail.com :stream_socket_client(): SSL operation failed with code 1. OpenSSL Error messages: error:1408F10B:SSL routines:ssl3_get_record:wrong version number (code: 0) (send); director@CforED.com {"exception":"[object] (Swift_TransportException(code: 0): Connection could not be established with host smtp.gmail.com :stream_socket_client(): SSL operation failed with code 1. OpenSSL Error messages:\nerror:1408F10B:SSL routines:ssl3_get_record:wrong version number\nLog data:\n++ Starting Swift_Transport_EsmtpTransport\n!! Connection could not be established with host smtp.gmail.com :stream_socket_client(): SSL operation failed with code 1. OpenSSL Error messages:\nerror:1408F10B:SSL routines:ssl3_get_record:wrong version number (code: 0) at /home/mautic/public_html/mautic.devced.com/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/LoggerPlugin.php:124)"} {"hostname":"35-236-118-198.cprapid.com","pid":518770}

LoggerPlugin.php:124 | Path

/home/mautic/public_html/mautic.devced.com/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/LoggerPlugin.php:124

LoggerPlugin.php:124 | Line

124: throw new Swift_TransportException($message, $code, $e->getPrevious());

<?php

/*
 * This file is part of SwiftMailer.
 * (c) 2004-2009 Chris Corbyn
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

/**
 * Does real time logging of Transport level information.
 *
 * @author     Chris Corbyn
 */
class Swift_Plugins_LoggerPlugin implements Swift_Events_CommandListener, Swift_Events_ResponseListener, Swift_Events_TransportChangeListener, Swift_Events_TransportExceptionListener, Swift_Plugins_Logger
{
    /** The logger which is delegated to */
    private $logger;

    /**
     * Create a new LoggerPlugin using $logger.
     */
    public function __construct(Swift_Plugins_Logger $logger)
    {
        $this->logger = $logger;
    }

    /**
     * Add a log entry.
     *
     * @param string $entry
     */
    public function add($entry)
    {
        $this->logger->add($entry);
    }

    /**
     * Clear the log contents.
     */
    public function clear()
    {
        $this->logger->clear();
    }

    /**
     * Get this log as a string.
     *
     * @return string
     */
    public function dump()
    {
        return $this->logger->dump();
    }

    /**
     * Invoked immediately following a command being sent.
     */
    public function commandSent(Swift_Events_CommandEvent $evt)
    {
        $command = $evt->getCommand();
        $this->logger->add(sprintf('>> %s', $command));
    }

    /**
     * Invoked immediately following a response coming back.
     */
    public function responseReceived(Swift_Events_ResponseEvent $evt)
    {
        $response = $evt->getResponse();
        $this->logger->add(sprintf('<< %s', $response));
    }

    /**
     * Invoked just before a Transport is started.
     */
    public function beforeTransportStarted(Swift_Events_TransportChangeEvent $evt)
    {
        $transportName = \get_class($evt->getSource());
        $this->logger->add(sprintf('++ Starting %s', $transportName));
    }

    /**
     * Invoked immediately after the Transport is started.
     */
    public function transportStarted(Swift_Events_TransportChangeEvent $evt)
    {
        $transportName = \get_class($evt->getSource());
        $this->logger->add(sprintf('++ %s started', $transportName));
    }

    /**
     * Invoked just before a Transport is stopped.
     */
    public function beforeTransportStopped(Swift_Events_TransportChangeEvent $evt)
    {
        $transportName = \get_class($evt->getSource());
        $this->logger->add(sprintf('++ Stopping %s', $transportName));
    }

    /**
     * Invoked immediately after the Transport is stopped.
     */
    public function transportStopped(Swift_Events_TransportChangeEvent $evt)
    {
        $transportName = \get_class($evt->getSource());
        $this->logger->add(sprintf('++ %s stopped', $transportName));
    }

    /**
     * Invoked as a TransportException is thrown in the Transport system.
     */
    public function exceptionThrown(Swift_Events_TransportExceptionEvent $evt)
    {
        $e = $evt->getException();
        $message = $e->getMessage();
        $code = $e->getCode();
        $this->logger->add(sprintf('!! %s (code: %s)', $message, $code));
        $message .= PHP_EOL;
        $message .= 'Log data:'.PHP_EOL;
        $message .= $this->logger->dump();
        $evt->cancelBubble();
        throw new Swift_TransportException($message, $code, $e->getPrevious());
    }
}
DevCEDTeam commented 1 year ago

The error message you provided indicates an issue with establishing a connection to the SMTP server hosted at smtp.gmail.com. The error specifically mentions an SSL error with code 1 and references the OpenSSL error message "error:1408F10B:SSL routines:ssl3_get_record:wrong version number." Here's a step-by-step guide to understanding and troubleshooting this error message:

Error Message:

[2023-08-28 05:50:35] mautic.ERROR: [MAIL ERROR] Connection could not be established with host smtp.gmail.com: stream_socket_client(): SSL operation failed with code 1. OpenSSL Error messages: error:1408F10B:SSL routines:ssl3_get_record:wrong version number Log data: ++ Starting Swift_Transport_EsmtpTransport !! Connection could not be established with host smtp.gmail.com: stream_socket_client(): SSL operation failed with code 1. OpenSSL Error messages: error:1408F10B:SSL routines:ssl3_get_record:wrong version number (code: 0) (send); director@CforED.com {"exception":"[object] (Swift_TransportException(code: 0): Connection could not be established with host smtp.gmail.com: stream_socket_client(): SSL operation failed with code 1. OpenSSL Error messages:\nerror:1408F10B:SSL routines:ssl3_get_record:wrong version number\nLog data:\n++ Starting Swift_Transport_EsmtpTransport\n!! Connection could not be established with host smtp.gmail.com: stream_socket_client(): SSL operation failed with code 1. OpenSSL Error messages:\nerror:1408F10B:SSL routines:ssl3_get_record:wrong version number (code: 0) at /home/mautic/public_html/mautic.devced.com/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/LoggerPlugin.php:124)"}
{"hostname":"35-236-118-198.cprapid.com","pid":521049}

Step-by-Step Guide:

  1. Error Analysis:    The error message indicates that there was a problem establishing a connection to the SMTP server hosted at smtp.gmail.com. The error specifically points out an SSL (Secure Sockets Layer) operation failure with code 1 and refers to the OpenSSL error message "error:1408F10B:SSL routines:ssl3_get_record:wrong version number."

  2. SSL/TLS Version Compatibility:    The "error:1408F10B:SSL routines:ssl3_get_record:wrong version number" part of the error message suggests that there might be a mismatch in SSL/TLS versions between the client (your application) and the server (smtp.gmail.com).

  3. Troubleshooting Steps:

   a. Check SSL/TLS Version:       Verify that your application's SSL/TLS configuration is compatible with the version supported by smtp.gmail.com. Check if there's a mismatch in the SSL version being used.

   b. Update Libraries:       Ensure that you're using the latest versions of libraries and components that handle SSL connections. Outdated libraries might not support the latest SSL/TLS versions.

   c. Check Encryption Protocols:       SMTP servers often require secure connections using protocols like TLS. Ensure that your application is using the correct encryption protocol and port (usually 587 for TLS).

   d. Firewall or Proxy Issues:       Sometimes, firewall rules or proxy configurations can interfere with SSL connections. Check if there are any restrictions or configurations affecting your application's network traffic.

   e. Server-Side SSL Configuration:       If you're managing your own server, ensure that the server's SSL configuration is correct and supports the necessary protocols.

   f. SSL Certificate:       Verify the SSL certificate being used. Expired or invalid SSL certificates can cause SSL connection failures.

  1. Summary:

   The error indicates a problem with SSL connection establishment to the smtp.gmail.com server. This could be due to SSL version mismatch, outdated libraries, incorrect encryption protocols, firewall or proxy issues, or SSL certificate problems. To resolve the error, ensure that your application's SSL/TLS configuration is up to date and compatible with the server's requirements. Double-check your encryption protocols, SSL certificate, and network configurations for any issues.