From 99f96fb6b81a417aecf51c4b778a5b877c34c236 Mon Sep 17 00:00:00 2001 From: "alexander.klyuchev" Date: Wed, 8 Jan 2025 09:27:32 +0200 Subject: [PATCH] review comments --- core/include/userver/server/component.hpp | 2 +- universal/include/userver/crypto/certificate.hpp | 2 +- universal/src/crypto/certificate.cpp | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/core/include/userver/server/component.hpp b/core/include/userver/server/component.hpp index 4501670a5d7b..2539dc358d69 100644 --- a/core/include/userver/server/component.hpp +++ b/core/include/userver/server/component.hpp @@ -63,7 +63,7 @@ namespace components { /// task_processor | task processor to process incoming requests | - /// backlog | max count of new connections pending acceptance | 1024 /// tls.ca | paths to TLS CAs for client authentication | - -/// tls.cert | path to TLS server certificate chain | - +/// tls.cert | path to TLS server certificate or certificate chain | - /// tls.private-key | path to TLS server certificate private key | - /// tls.private-key-passphrase-name | passphrase name located in secdist's "passphrases" section | - /// handler-defaults.max_url_size | max path/URL size or empty to not limit | 8192 diff --git a/universal/include/userver/crypto/certificate.hpp b/universal/include/userver/crypto/certificate.hpp index bbcd12065320..ea2cf2f49e94 100644 --- a/universal/include/userver/crypto/certificate.hpp +++ b/universal/include/userver/crypto/certificate.hpp @@ -52,7 +52,7 @@ using CertificatesChain = std::list; /// list of 'Certificate's. /// /// @throw crypto::KeyParseError if failed to load the certificate. -CertificatesChain LoadCertficatesChainFromString(std::string_view certificatesChain); +CertificatesChain LoadCertficatesChainFromString(std::string_view chain); } // namespace crypto diff --git a/universal/src/crypto/certificate.cpp b/universal/src/crypto/certificate.cpp index 163b27fc65d4..1ae220d33c0c 100644 --- a/universal/src/crypto/certificate.cpp +++ b/universal/src/crypto/certificate.cpp @@ -58,8 +58,8 @@ Certificate Certificate::LoadFromString(std::string_view certificate) { CertificatesChain LoadCertficatesChainFromString(std::string_view chain) { CertificatesChain certificates; - const std::string beginMarker = "-----BEGIN CERTIFICATE-----"; - const std::string endMarker = "-----END CERTIFICATE-----"; + constexpr std::string_view beginMarker = "-----BEGIN CERTIFICATE-----"; + constexpr std::string_view endMarker = "-----END CERTIFICATE-----"; size_t start = 0; while ((start = chain.find(beginMarker, start)) != std::string::npos) {