diff options
author | Paul Cristian Sarbu <paul.cristian.sarbu@huawei.com> | 2024-06-27 16:05:05 +0200 |
---|---|---|
committer | Paul Cristian Sarbu <paul.cristian.sarbu@huawei.com> | 2024-07-04 16:05:08 +0200 |
commit | 0cbc8e226b39ec731373b80024e23cc0580c27ac (patch) | |
tree | fa6737a19491b8e062704f728243689429d4069c /src/buildtool/main/main.cpp | |
parent | 74f53b444853850144c3e63593f83c424e84a768 (diff) | |
download | justbuild-0cbc8e226b39ec731373b80024e23cc0580c27ac.tar.gz |
Use Auth and TLS configurations via Instance()
...to more easily keep track of changes during refactoring.
Diffstat (limited to 'src/buildtool/main/main.cpp')
-rw-r--r-- | src/buildtool/main/main.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/buildtool/main/main.cpp b/src/buildtool/main/main.cpp index 041046bf..1ae9c0ce 100644 --- a/src/buildtool/main/main.cpp +++ b/src/buildtool/main/main.cpp @@ -190,7 +190,7 @@ void SetupAuthConfig(CommonAuthArguments const& authargs, auto use_tls = false; if (authargs.tls_ca_cert) { use_tls = true; - if (not Auth::TLS::SetCACertificate(*authargs.tls_ca_cert)) { + if (not Auth::TLS::Instance().SetCACertificate(*authargs.tls_ca_cert)) { Logger::Log(LogLevel::Error, "Could not read '{}' certificate.", authargs.tls_ca_cert->string()); @@ -199,7 +199,7 @@ void SetupAuthConfig(CommonAuthArguments const& authargs, } if (client_authargs.tls_client_cert) { use_tls = true; - if (not Auth::TLS::SetClientCertificate( + if (not Auth::TLS::Instance().SetClientCertificate( *client_authargs.tls_client_cert)) { Logger::Log(LogLevel::Error, "Could not read '{}' certificate.", @@ -209,7 +209,8 @@ void SetupAuthConfig(CommonAuthArguments const& authargs, } if (client_authargs.tls_client_key) { use_tls = true; - if (not Auth::TLS::SetClientKey(*client_authargs.tls_client_key)) { + if (not Auth::TLS::Instance().SetClientKey( + *client_authargs.tls_client_key)) { Logger::Log(LogLevel::Error, "Could not read '{}' key.", client_authargs.tls_client_key->string()); @@ -219,7 +220,7 @@ void SetupAuthConfig(CommonAuthArguments const& authargs, if (server_authargs.tls_server_cert) { use_tls = true; - if (not Auth::TLS::SetServerCertificate( + if (not Auth::TLS::Instance().SetServerCertificate( *server_authargs.tls_server_cert)) { Logger::Log(LogLevel::Error, "Could not read '{}' certificate.", @@ -229,7 +230,8 @@ void SetupAuthConfig(CommonAuthArguments const& authargs, } if (server_authargs.tls_server_key) { use_tls = true; - if (not Auth::TLS::SetServerKey(*server_authargs.tls_server_key)) { + if (not Auth::TLS::Instance().SetServerKey( + *server_authargs.tls_server_key)) { Logger::Log(LogLevel::Error, "Could not read '{}' key.", server_authargs.tls_server_key->string()); @@ -238,7 +240,7 @@ void SetupAuthConfig(CommonAuthArguments const& authargs, } if (use_tls) { - if (not Auth::TLS::Validate()) { + if (not Auth::TLS::Instance().Validate()) { std::exit(kExitFailure); } } |