Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SMTP TLS problem with Email v2.7.1 #2150

Closed
withindale opened this issue Aug 18, 2018 · 4 comments
Closed

SMTP TLS problem with Email v2.7.1 #2150

withindale opened this issue Aug 18, 2018 · 4 comments
Labels

Comments

@withindale
Copy link

Email plug-in works with SSL and no security but fails with TLS on port 587 at TMD Hosting - see below.

Ian Russell

Whoops\Exception\ErrorException thrown with message "stream_socket_enable_crypto(): SSL operation failed with code 1. OpenSSL Error messages:
error:1408F10B:SSL routines:SSL3_GET_RECORD:wrong version number"

Stacktrace:
#23 Whoops\Exception\ErrorException in /home/codewayb/public_html/grav-site-1/user/plugins/email/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/StreamBuffer.php:94
#22 stream_socket_enable_crypto in /home/codewayb/public_html/grav-site-1/user/plugins/email/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/StreamBuffer.php:94
#21 Swift_Transport_StreamBuffer:startTLS in /home/codewayb/public_html/grav-site-1/user/plugins/email/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/EsmtpTransport.php:313
#20 Swift_Transport_EsmtpTransport:_doHeloCommand in /home/codewayb/public_html/grav-site-1/user/plugins/email/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/AbstractSmtpTransport.php:118
#19 Swift_Transport_AbstractSmtpTransport:start in /home/codewayb/public_html/grav-site-1/user/plugins/email/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mailer.php:79
#18 Swift_Mailer:send in /home/codewayb/public_html/grav-site-1/user/plugins/email/classes/Email.php:104
#17 Grav\Plugin\Email\Email:send in /home/codewayb/public_html/grav-site-1/user/plugins/email/email.php:99
#16 Grav\Plugin\EmailPlugin:onFormProcessed in /home/codewayb/public_html/grav-site-1/vendor/symfony/event-dispatcher/EventDispatcher.php:212
#15 Symfony\Component\EventDispatcher\EventDispatcher:doDispatch in /home/codewayb/public_html/grav-site-1/vendor/symfony/event-dispatcher/EventDispatcher.php:44
#14 Symfony\Component\EventDispatcher\EventDispatcher:dispatch in /home/codewayb/public_html/grav-site-1/vendor/rockettheme/toolbox/Event/src/EventDispatcher.php:23
#13 RocketTheme\Toolbox\Event\EventDispatcher:dispatch in /home/codewayb/public_html/grav-site-1/system/src/Grav/Common/Grav.php:279
#12 Grav\Common\Grav:fireEvent in /home/codewayb/public_html/grav-site-1/user/plugins/form/classes/Form.php:729
#11 Grav\Plugin\Form\Form:post in /home/codewayb/public_html/grav-site-1/user/plugins/form/form.php:195
#10 Grav\Plugin\FormPlugin:onPageInitialized in /home/codewayb/public_html/grav-site-1/vendor/symfony/event-dispatcher/EventDispatcher.php:212
#9 Symfony\Component\EventDispatcher\EventDispatcher:doDispatch in /home/codewayb/public_html/grav-site-1/vendor/symfony/event-dispatcher/EventDispatcher.php:44
#8 Symfony\Component\EventDispatcher\EventDispatcher:dispatch in /home/codewayb/public_html/grav-site-1/vendor/rockettheme/toolbox/Event/src/EventDispatcher.php:23
#7 RocketTheme\Toolbox\Event\EventDispatcher:dispatch in /home/codewayb/public_html/grav-site-1/system/src/Grav/Common/Grav.php:279
#6 Grav\Common\Grav:fireEvent in /home/codewayb/public_html/grav-site-1/system/src/Grav/Common/Processors/PagesProcessor.php:26
#5 Grav\Common\Processors\PagesProcessor:process in /home/codewayb/public_html/grav-site-1/system/src/Grav/Common/Grav.php:131
#4 Grav\Common\Grav:Grav\Common{closure} in /home/codewayb/public_html/grav-site-1/system/src/Grav/Common/Grav.php:370
#3 Grav\Common\Grav:Grav\Common{closure} in /home/codewayb/public_html/grav-site-1/system/src/Grav/Common/Grav.php:346
#2 call_user_func_array in /home/codewayb/public_html/grav-site-1/system/src/Grav/Common/Grav.php:346
#1 Grav\Common\Grav:__call in /home/codewayb/public_html/grav-site-1/system/src/Grav/Common/Grav.php:132
#0 Grav\Common\Grav:process in /home/codewayb/public_html/grav-site-1/index.php:52

/home/codewayb/public_html/grav-site-1/user/plugins/email/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/StreamBuffer.php
if (isset($this->_stream)) {
switch ($param) {
case 'timeout':
if ($this->_stream) {
stream_set_timeout($this->_stream, $value);
}
break;

            case 'blocking':
                if ($this->_stream) {
                    stream_set_blocking($this->_stream, 1);
                }
        }
    }
    $this->_params[$param] = $value;
}

public function startTLS()
{
    return stream_socket_enable_crypto($this->_stream, true, STREAM_CRYPTO_METHOD_TLS_CLIENT);
}

/**
 * Perform any shutdown logic needed.
 */
public function terminate()
{
    if (isset($this->_stream)) {
        switch ($this->_params['type']) {
            case self::TYPE_PROCESS:
                fclose($this->_in);
                fclose($this->_out);
                proc_close($this->_stream);
                break;
            case self::TYPE_SOCKET:
            default:
                fclose($this->_stream);
                break;
        }
    }

Arguments
"""
stream_socket_enable_crypto(): SSL operation failed with code 1. OpenSSL Error messages:\n
error:1408F10B:SSL routines:SSL3_GET_RECORD:wrong version number
"""

@rhukster
Copy link
Member

Looks like a problem with your SSL lib version on your hosting provider.

@withindale
Copy link
Author

withindale commented Aug 18, 2018 via email

@rhukster
Copy link
Member

Well, we're just using Swift email library, and the error comes from there. Swift is the most widely used, and most robust email library available, so if it doesn't work with TMD, i'm going to bet the problem lies on their end, and not on Swift. :)

Glad you are able to use SSL though.

@withindale
Copy link
Author

withindale commented Aug 19, 2018 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants