diff options
author | Mark D. Roth <roth@google.com> | 2017-06-29 10:43:00 -0700 |
---|---|---|
committer | Mark D. Roth <roth@google.com> | 2017-06-29 10:43:00 -0700 |
commit | be928be48acf7cafdf82b99a5bc5ba7e620a1f06 (patch) | |
tree | 27321c124e4dc8440d5e9b78cbd28cc9f1830f7c /src/core/lib/http | |
parent | a410632b570a8717eb5f3c1f43eb84bf80e0aca9 (diff) |
Allow HTTP CONNECT handshaker to be used in http1 client.
Diffstat (limited to 'src/core/lib/http')
-rw-r--r-- | src/core/lib/http/httpcli_security_connector.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/core/lib/http/httpcli_security_connector.c b/src/core/lib/http/httpcli_security_connector.c index 34a77c3bf4..97c2886525 100644 --- a/src/core/lib/http/httpcli_security_connector.c +++ b/src/core/lib/http/httpcli_security_connector.c @@ -25,6 +25,7 @@ #include <grpc/support/string_util.h> #include "src/core/lib/channel/channel_args.h" +#include "src/core/lib/channel/handshaker_registry.h" #include "src/core/lib/security/transport/security_handshaker.h" #include "src/core/lib/slice/slice_internal.h" #include "src/core/lib/support/string.h" @@ -157,7 +158,6 @@ static void ssl_handshake(grpc_exec_ctx *exec_ctx, void *arg, gpr_timespec deadline, void (*on_done)(grpc_exec_ctx *exec_ctx, void *arg, grpc_endpoint *endpoint)) { - grpc_channel_security_connector *sc = NULL; on_done_closure *c = gpr_malloc(sizeof(*c)); const char *pem_root_certs = grpc_get_default_ssl_roots(); if (pem_root_certs == NULL) { @@ -168,11 +168,13 @@ static void ssl_handshake(grpc_exec_ctx *exec_ctx, void *arg, } c->func = on_done; c->arg = arg; - c->handshake_mgr = grpc_handshake_manager_create(); + grpc_channel_security_connector *sc = NULL; GPR_ASSERT(httpcli_ssl_channel_security_connector_create( exec_ctx, pem_root_certs, host, &sc) == GRPC_SECURITY_OK); - grpc_channel_security_connector_add_handshakers(exec_ctx, sc, - c->handshake_mgr); + grpc_arg channel_arg = grpc_security_connector_to_arg(&sc->base); + grpc_channel_args args = {1, &channel_arg}; + c->handshake_mgr = grpc_handshake_manager_create(); + grpc_handshakers_add(exec_ctx, HANDSHAKER_CLIENT, &args, c->handshake_mgr); grpc_handshake_manager_do_handshake( exec_ctx, c->handshake_mgr, tcp, NULL /* channel_args */, deadline, NULL /* acceptor */, on_handshake_done, c /* user_data */); |