From 7b169b6e83e32c75fca69207a9396536127428f8 Mon Sep 17 00:00:00 2001 From: ctippler Date: Fri, 15 Sep 2023 08:00:49 +0200 Subject: [PATCH] allow setting of ssl_verification without ssl_key... + fix doc (ssl_verification is by default true) --- README.md | 2 +- src/DependencyInjection/Configuration.php | 2 +- src/EsClientFactory.php | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 843cb43..3671f59 100644 --- a/README.md +++ b/README.md @@ -49,7 +49,7 @@ pimcore_elasticsearch_client: ssl_key: 'path/to/ssl/key' ssl_cert: 'path/to/ssl/cert' ssl_password: 'secretePW' - ssl_verification: false #false is the default value + ssl_verification: false #true is the default value http_options: proxy: 'http://localhost:8125' cloud_id: '123456789' diff --git a/src/DependencyInjection/Configuration.php b/src/DependencyInjection/Configuration.php index 46843bd..9475d63 100644 --- a/src/DependencyInjection/Configuration.php +++ b/src/DependencyInjection/Configuration.php @@ -63,7 +63,7 @@ public function getConfigTreeBuilder() ->info('If private key and certificate require a password (default: null)') ->end() ->booleanNode('ssl_verification') - ->info('Enable or disable the SSL verification (default: false)') + ->info('Enable or disable the SSL verification (default: true)') ->end() ->arrayNode('http_options') ->prototype('scalar')->end() diff --git a/src/EsClientFactory.php b/src/EsClientFactory.php index 6cd7ad4..b16e64c 100644 --- a/src/EsClientFactory.php +++ b/src/EsClientFactory.php @@ -45,10 +45,10 @@ public static function create(LoggerInterface $logger, array $configuration): Cl $builder ->setSSLKey($configuration['ssl_key'], $configuration['ssl_password'] ?? null) ->setSSLCert($configuration['ssl_cert'], $configuration['ssl_password'] ?? null); + } - if (isset($configuration['ssl_verification'])) { - $builder->setSSLVerification($configuration['ssl_verification']); - } + if (isset($configuration['ssl_verification'])) { + $builder->setSSLVerification($configuration['ssl_verification']); } if (isset($configuration['http_options'])) {