From 64f65458e3679ac0937ebfcd4a5fe78b31d9965b Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Mon, 19 Jan 2015 15:17:09 -0800 Subject: [PATCH] Allow secure connections with fling server --- test/core/fling/server.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/test/core/fling/server.c b/test/core/fling/server.c index 705ab3aca24..e4e7ad175cb 100644 --- a/test/core/fling/server.c +++ b/test/core/fling/server.c @@ -32,6 +32,7 @@ */ #include +#include #include #include @@ -47,6 +48,7 @@ #include #include #include "test/core/util/port.h" +#include "test/core/end2end/data/ssl_test_data.h" static grpc_completion_queue *cq; static grpc_server *server; @@ -98,8 +100,14 @@ int main(int argc, char **argv) { gpr_log(GPR_INFO, "creating server on: %s", addr); cq = grpc_completion_queue_create(); - server = grpc_server_create(cq, NULL); - GPR_ASSERT(grpc_server_add_http2_port(server, addr)); + if (secure) { + grpc_server_credentials *ssl_creds = grpc_ssl_server_credentials_create(NULL, 0, test_server1_key, test_server1_key_size, test_server1_cert, test_server1_cert_size); + server = grpc_secure_server_create(ssl_creds, cq, NULL); + GPR_ASSERT(grpc_server_add_secure_http2_port(server, addr)); + } else { + server = grpc_server_create(cq, NULL); + GPR_ASSERT(grpc_server_add_http2_port(server, addr)); + } grpc_server_start(server); gpr_free(addr_buf);