Skip to content

Commit

Permalink
tlsv1.2 by default
Browse files Browse the repository at this point in the history
  • Loading branch information
aynsix committed Oct 19, 2023
1 parent 37ba13c commit 82a310a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion lib/Alchemy/Phrasea/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -689,13 +689,17 @@ private function setupSwiftMailer()
$encryption = null;
$secureMode = '';

if (in_array($app['conf']->get(['registry', 'email', 'smtp-secure-mode']), ['ssl', 'tlsv1.1', 'tlsv1.2'])) {
if (in_array($app['conf']->get(['registry', 'email', 'smtp-secure-mode']), ['ssl', 'tls', 'tlsv1.1', 'tlsv1.2'])) {
$secureMode = $app['conf']->get(['registry', 'email', 'smtp-secure-mode']);

if ($secureMode == 'ssl') {
$encryption = 'ssl';
} else {
$encryption = 'tls';
if ($secureMode == 'tls') {
// by default use tlsv1.2
$secureMode = 'tlsv1.2';
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ private function getDefaultData(array $config)
'smtp-auth-enabled' => false,
'smtp-host' => null,
'smtp-port' => null,
'smtp-secure-mode' => 'tlsv1.1',
'smtp-secure-mode' => 'tlsv1.2',
'smtp-user' => null,
'smtp-password' => isset($config['email']['smtp-password']) ? $config['email']['smtp-password'] : null,
],
Expand Down
2 changes: 1 addition & 1 deletion lib/Alchemy/Phrasea/Form/Configuration/EmailFormType.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public function buildForm(FormBuilderInterface $builder, array $options)
]);
$builder->add('smtp-secure-mode', ChoiceType::class, [
'label' => 'SMTP encryption',
'choices' => ['none' => 'None', 'ssl' => 'SSL', 'tlsv1.1' => 'TLS1.1', 'tlsv1.2' => 'TLS1.2'],
'choices' => ['none' => 'None', 'ssl' => 'SSL', 'tlsv1.1' => 'TLSV1.1', 'tlsv1.2' => 'TLSV1.2'],
]);
$builder->add('smtp-user', TextType::class, [
'label' => 'SMTP user',
Expand Down

0 comments on commit 82a310a

Please sign in to comment.