From e848403ae5ed356b3013eda4ff284a1c501b1699 Mon Sep 17 00:00:00 2001 From: Pierrick VIGNAND Date: Thu, 7 Dec 2023 14:26:22 +0100 Subject: [PATCH] feat: allow to provide more ssl options --- DependencyInjection/Configuration.php | 13 +++++++++++++ Tests/fixtures/default_configuration.php | 3 +++ Tests/fixtures/default_configuration.yml | 3 +++ 3 files changed, 19 insertions(+) diff --git a/DependencyInjection/Configuration.php b/DependencyInjection/Configuration.php index f0b38ad..74daa11 100644 --- a/DependencyInjection/Configuration.php +++ b/DependencyInjection/Configuration.php @@ -95,8 +95,21 @@ public function getConfigTreeBuilder(): TreeBuilder ->arrayNode('ssl_options') ->children() ->booleanNode('verify_peer')->end() + ->scalarNode('verify_peer_name') + ->validate() + ->ifNotInArray([true, false, null]) + ->thenInvalid('Invalid value "%s" for option "verify_peer_name" bool|null expected') + ->end() + ->end() + ->scalarNode('allow_self_signed') + ->validate() + ->ifNotInArray([true, false, null]) + ->thenInvalid('Invalid value "%s" for option "allow_self_signed" bool|null expected') + ->end() + ->end() ->scalarNode('cafile')->end() ->scalarNode('local_cert')->end() + ->scalarNode('ciphers')->end() ->end() ->end() ->end() diff --git a/Tests/fixtures/default_configuration.php b/Tests/fixtures/default_configuration.php index 362ce4f..cd5765f 100644 --- a/Tests/fixtures/default_configuration.php +++ b/Tests/fixtures/default_configuration.php @@ -17,8 +17,11 @@ 'ssl' => false, 'ssl_options' => [ 'verify_peer' => true, + 'verify_peer_name' => null, + 'allow_self_signed' => null, 'cafile' => null, 'local_cert' => null, + 'ciphers' => null, ], ], ], diff --git a/Tests/fixtures/default_configuration.yml b/Tests/fixtures/default_configuration.yml index 8d3aabb..2d2d183 100644 --- a/Tests/fixtures/default_configuration.yml +++ b/Tests/fixtures/default_configuration.yml @@ -18,8 +18,11 @@ swarrot: ssl: false ssl_options: verify_peer: ~ + verify_peer_name: ~ + allow_self_signed: ~ cafile: ~ local_cert: ~ + ciphers: ~ consumers: # Prototype