diff options
author | Sree Kuchibhotla <sreek@google.com> | 2016-04-26 11:27:14 -0700 |
---|---|---|
committer | Sree Kuchibhotla <sreek@google.com> | 2016-04-26 11:27:14 -0700 |
commit | 30499760db987c67fe71839c52c24473a5365e0c (patch) | |
tree | 9b9965393a6346ee9b0b34032349925b366b9532 /src/node | |
parent | 0b9fdd8adc4b2d167e33a6d39e7ff4a46ef9a65c (diff) | |
parent | c3d869ef5853c4cfad57b7d3694d5260eeb7ce75 (diff) |
Merge branch 'master' into server_channel_affinity
Diffstat (limited to 'src/node')
-rw-r--r-- | src/node/ext/server_credentials.cc | 13 | ||||
-rw-r--r-- | src/node/performance/worker.js | 2 | ||||
-rw-r--r-- | src/node/performance/worker_service_impl.js | 3 |
3 files changed, 14 insertions, 4 deletions
diff --git a/src/node/ext/server_credentials.cc b/src/node/ext/server_credentials.cc index 5285d53df4..cff821aafc 100644 --- a/src/node/ext/server_credentials.cc +++ b/src/node/ext/server_credentials.cc @@ -145,9 +145,13 @@ NAN_METHOD(ServerCredentials::CreateSsl) { return Nan::ThrowTypeError( "createSsl's second argument must be a list of objects"); } - int force_client_auth = 0; + + grpc_ssl_client_certificate_request_type client_certificate_request; if (info[2]->IsBoolean()) { - force_client_auth = (int)Nan::To<bool>(info[2]).FromJust(); + client_certificate_request = + Nan::To<bool>(info[2]).FromJust() + ? GRPC_SSL_REQUEST_AND_REQUIRE_CLIENT_CERTIFICATE_AND_VERIFY + : GRPC_SSL_DONT_REQUEST_CLIENT_CERTIFICATE; } else if (!(info[2]->IsUndefined() || info[2]->IsNull())) { return Nan::ThrowTypeError( "createSsl's third argument must be a boolean if provided"); @@ -180,8 +184,9 @@ NAN_METHOD(ServerCredentials::CreateSsl) { key_cert_pairs[i].private_key = ::node::Buffer::Data(maybe_key); key_cert_pairs[i].cert_chain = ::node::Buffer::Data(maybe_cert); } - grpc_server_credentials *creds = grpc_ssl_server_credentials_create( - root_certs, key_cert_pairs, key_cert_pair_count, force_client_auth, NULL); + grpc_server_credentials *creds = grpc_ssl_server_credentials_create_ex( + root_certs, key_cert_pairs, key_cert_pair_count, + client_certificate_request, NULL); delete key_cert_pairs; if (creds == NULL) { info.GetReturnValue().SetNull(); diff --git a/src/node/performance/worker.js b/src/node/performance/worker.js index 98577bdbc9..7ef9b84fe7 100644 --- a/src/node/performance/worker.js +++ b/src/node/performance/worker.js @@ -33,6 +33,7 @@ 'use strict'; +var console = require('console'); var worker_service_impl = require('./worker_service_impl'); var grpc = require('../../../'); @@ -48,6 +49,7 @@ function runServer(port) { var address = '0.0.0.0:' + port; server.bind(address, server_creds); server.start(); + console.log('running QPS worker on %s', address); return server; } diff --git a/src/node/performance/worker_service_impl.js b/src/node/performance/worker_service_impl.js index 17458e4b93..4b5cb8f9c2 100644 --- a/src/node/performance/worker_service_impl.js +++ b/src/node/performance/worker_service_impl.js @@ -34,6 +34,7 @@ 'use strict'; var os = require('os'); +var console = require('console'); var BenchmarkClient = require('./benchmark_client'); var BenchmarkServer = require('./benchmark_server'); @@ -49,6 +50,7 @@ exports.runClient = function runClient(call) { switch (request.argtype) { case 'setup': var setup = request.setup; + console.log('ClientConfig %j', setup); client = new BenchmarkClient(setup.server_targets, setup.client_channels, setup.histogram_params, @@ -118,6 +120,7 @@ exports.runServer = function runServer(call) { var stats; switch (request.argtype) { case 'setup': + console.log('ServerConfig %j', request.setup); server = new BenchmarkServer('[::]', request.setup.port, request.setup.security_params); server.start(); |