aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/cpp/qps/server.h
diff options
context:
space:
mode:
authorGravatar Guantao Liu <guantaol@google.com>2017-07-12 17:36:30 -0700
committerGravatar Guantao Liu <guantaol@google.com>2017-07-12 17:36:30 -0700
commitabe3cf51f02d48b28fd67d78e7a3060d763148b5 (patch)
treec3105d148ef9cfc57b367d175b6df83bfc349a65 /test/cpp/qps/server.h
parentf2e15655bc6eaa4bbe66234946056856ede090da (diff)
Add a new metric 'Queries/CPU-sec'.
Enable internal credential types.
Diffstat (limited to 'test/cpp/qps/server.h')
-rw-r--r--test/cpp/qps/server.h15
1 files changed, 9 insertions, 6 deletions
diff --git a/test/cpp/qps/server.h b/test/cpp/qps/server.h
index 4b699e0708..c0dac96d8b 100644
--- a/test/cpp/qps/server.h
+++ b/test/cpp/qps/server.h
@@ -32,6 +32,7 @@
#include "test/core/end2end/data/ssl_test_data.h"
#include "test/core/util/port.h"
#include "test/cpp/qps/usage_timer.h"
+#include "test/cpp/util/test_credentials_provider.h"
namespace grpc {
namespace testing {
@@ -89,12 +90,14 @@ class Server {
static std::shared_ptr<ServerCredentials> CreateServerCredentials(
const ServerConfig& config) {
if (config.has_security_params()) {
- SslServerCredentialsOptions::PemKeyCertPair pkcp = {test_server1_key,
- test_server1_cert};
- SslServerCredentialsOptions ssl_opts;
- ssl_opts.pem_root_certs = "";
- ssl_opts.pem_key_cert_pairs.push_back(pkcp);
- return SslServerCredentials(ssl_opts);
+ grpc::string type;
+ if (config.security_params().cred_type().empty()) {
+ type = kTlsCredentialsType;
+ } else {
+ type = config.security_params().cred_type();
+ }
+
+ return GetCredentialsProvider()->GetServerCredentials(type);
} else {
return InsecureServerCredentials();
}