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

Changing the encryption Key renders email settings unavaible with SMTP enabled #3083

Closed
jan-thoma opened this issue Jul 10, 2018 · 3 comments
Assignees

Comments

@jan-thoma
Copy link

Description

If the encryption gets changed for some reason and SMTP with credentials is enabled the email settings can't be accessed in the cp, therefore it's necessary to patch the database manually.

Steps to reproduce

  1. Setup SMTP with credentials
  2. Change the encryption key
  3. Try to to access the cp email settings

Additional info

  • Craft version: Craft Pro 3.0.15
  • PHP version: 7.1.17
  • Database driver & version: PostgreSQL 10.4
@brandonkelly
Copy link
Member

Can you provide the error + stack trace you’re getting? (You should be able to access the stack trace by searching for the error in storage/logs/web.log.)

@jan-thoma
Copy link
Author

jan-thoma commented Jul 10, 2018

Exception – yii\base\Exception
OpenSSL failure on decryption: error:0606506D:digital envelope routines:EVP_DecryptFinal_ex:wrong final block length

Stack trace:
#0 /var/www/rincoultrasonics.com/craft/vendor/yiisoft/yii2/base/Security.php(157): yii\base\Security->decrypt('', false, 'CNhLp02l19YGa3K...', NULL)
#1 /var/www/rincoultrasonics.com/craft/vendor/craftcms/cms/src/services/Security.php(179): yii\base\Security->decryptByKey('\xEBA\r\x89T*\x8E]K\x86\xE2\xF7 \xAD\xD8...', 'CNhLp02l19YGa3K...', NULL)
#2 /var/www/rincoultrasonics.com/craft/vendor/craftcms/cms/src/helpers/StringHelper.php(919): craft\services\Security->decryptByKey('\xEBA\r\x89T*\x8E]K\x86\xE2\xF7 \xAD\xD8...')
#3 /var/www/rincoultrasonics.com/craft/vendor/craftcms/cms/src/mail/transportadapters/Smtp.php(81): craft\helpers\StringHelper::decdec('crypt:\xEBA\r\x89T*\x8E]K...')
#4 /var/www/rincoultrasonics.com/craft/vendor/yiisoft/yii2/base/BaseObject.php(109): craft\mail\transportadapters\Smtp->init()
#5 /var/www/rincoultrasonics.com/craft/vendor/craftcms/cms/src/helpers/Component.php(80): yii\base\BaseObject->__construct(Array)
#6 /var/www/rincoultrasonics.com/craft/vendor/craftcms/cms/src/helpers/MailerHelper.php(91): craft\helpers\Component::createComponent(Array, 'craft\\mail\\tran...')
#7 /var/www/rincoultrasonics.com/craft/vendor/craftcms/cms/src/controllers/SystemSettingsController.php(155): craft\helpers\MailerHelper::createTransportAdapter('craft\\mail\\tran...', Array)
#8 [internal function]: craft\controllers\SystemSettingsController->actionEditEmailSettings(Object(craft\models\MailSettings), NULL)
#9 /var/www/rincoultrasonics.com/craft/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#10 /var/www/rincoultrasonics.com/craft/vendor/yiisoft/yii2/base/Controller.php(157): yii\base\InlineAction->runWithParams(Array)
#11 /var/www/rincoultrasonics.com/craft/vendor/craftcms/cms/src/web/Controller.php(103): yii\base\Controller->runAction('edit-email-sett...', Array)
#12 /var/www/rincoultrasonics.com/craft/vendor/yiisoft/yii2/base/Module.php(528): craft\web\Controller->runAction('edit-email-sett...', Array)
#13 /var/www/rincoultrasonics.com/craft/vendor/craftcms/cms/src/web/Application.php(282): yii\base\Module->runAction('system-settings...', Array)
#14 /var/www/rincoultrasonics.com/craft/vendor/yiisoft/yii2/web/Application.php(103): craft\web\Application->runAction('system-settings...', Array)
#15 /var/www/rincoultrasonics.com/craft/vendor/craftcms/cms/src/web/Application.php(271): yii\web\Application->handleRequest(Object(craft\web\Request))
#16 /var/www/rincoultrasonics.com/craft/vendor/yiisoft/yii2/base/Application.php(386): craft\web\Application->handleRequest(Object(craft\web\Request))
#17 /var/www/rincoultrasonics.com/craft/web/index.php(21): yii\base\Application->run()
#18 {main}```

@angrybrad angrybrad self-assigned this Jul 11, 2018
@brandonkelly
Copy link
Member

Thanks – fixed for the next release!

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

No branches or pull requests

3 participants