diff options
author | monster <monster@ydb.tech> | 2022-07-07 14:41:37 +0300 |
---|---|---|
committer | monster <monster@ydb.tech> | 2022-07-07 14:41:37 +0300 |
commit | 06e5c21a835c0e923506c4ff27929f34e00761c2 (patch) | |
tree | 75efcbc6854ef9bd476eb8bf00cc5c900da436a2 /library/cpp/neh/https.h | |
parent | 03f024c4412e3aa613bb543cf1660176320ba8f4 (diff) | |
download | ydb-06e5c21a835c0e923506c4ff27929f34e00761c2.tar.gz |
fix ya.make
Diffstat (limited to 'library/cpp/neh/https.h')
-rw-r--r-- | library/cpp/neh/https.h | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/library/cpp/neh/https.h b/library/cpp/neh/https.h new file mode 100644 index 0000000000..6dbb5370d7 --- /dev/null +++ b/library/cpp/neh/https.h @@ -0,0 +1,47 @@ +#pragma once + +#include <contrib/libs/openssl/include/openssl/ossl_typ.h> + +#include <util/generic/string.h> +#include <util/generic/strbuf.h> + +#include <functional> + +namespace NNeh { + class IProtocol; + struct TParsedLocation; + + IProtocol* SSLGetProtocol(); + IProtocol* SSLPostProtocol(); + IProtocol* SSLFullProtocol(); + + /// if exceed soft limit, reduce quantity unused connections in cache + void SetHttpOutputConnectionsLimits(size_t softLimit, size_t hardLimit); + + /// if exceed soft limit, reduce keepalive time for unused connections + void SetHttpInputConnectionsLimits(size_t softLimit, size_t hardLimit); + + /// unused input sockets keepalive timeouts + /// real(used) timeout: + /// - max, if not reached soft limit + /// - min, if reached hard limit + /// - approx. linear changed[max..min], while conn. count in range [soft..hard] + void SetHttpInputConnectionsTimeouts(unsigned minSeconds, unsigned maxSeconds); + + struct THttpsOptions { + using TVerifyCallback = int (*)(int, X509_STORE_CTX*); + using TPasswordCallback = std::function<TString (const TParsedLocation&, const TString&, const TString&)>; + static TString CAFile; + static TString CAPath; + static TString ClientCertificate; + static TString ClientPrivateKey; + static TString ClientPrivateKeyPassword; + static bool CheckCertificateHostname; + static bool EnableSslServerDebug; + static bool EnableSslClientDebug; + static TVerifyCallback ClientVerifyCallback; + static TPasswordCallback KeyPasswdCallback; + static bool RedirectionNotError; + static bool Set(TStringBuf name, TStringBuf value); + }; +} |