diff options
Diffstat (limited to 'src/buildtool/common/remote/client_common.hpp')
-rw-r--r-- | src/buildtool/common/remote/client_common.hpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/buildtool/common/remote/client_common.hpp b/src/buildtool/common/remote/client_common.hpp index eb4af68f..4fd9e9a7 100644 --- a/src/buildtool/common/remote/client_common.hpp +++ b/src/buildtool/common/remote/client_common.hpp @@ -32,15 +32,14 @@ [[maybe_unused]] [[nodiscard]] static inline auto CreateChannelWithCredentials( std::string const& server, - Port port) noexcept { + Port port, + Auth::TLS const* auth) noexcept { std::shared_ptr<grpc::ChannelCredentials> creds; std::string address = server + ':' + std::to_string(port); - if (Auth::Instance().GetAuthMethod() == AuthMethod::kTLS) { - auto tls_opts = - grpc::SslCredentialsOptions{Auth::TLS::Instance().CACert(), - Auth::TLS::Instance().ClientKey(), - Auth::TLS::Instance().ClientCert()}; + if (auth != nullptr) { + auto tls_opts = grpc::SslCredentialsOptions{ + auth->CACert(), auth->ClientKey(), auth->ClientCert()}; creds = grpc::SslCredentials(tls_opts); } else { |