aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/node/test/server_test.js
diff options
context:
space:
mode:
authorGravatar murgatroid99 <mlumish@google.com>2015-07-27 16:13:28 -0700
committerGravatar murgatroid99 <mlumish@google.com>2015-07-27 16:13:28 -0700
commit1a7dcac038dfb64ca499847b42f1ccb03849211f (patch)
tree614542fa24bdb718815e90034219a904e0623b50 /src/node/test/server_test.js
parent2aff2b449f22e0eb7995d31a6c137e6a5951d6c6 (diff)
Made binding a server to a port insecurely explicit
Diffstat (limited to 'src/node/test/server_test.js')
-rw-r--r--src/node/test/server_test.js19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/node/test/server_test.js b/src/node/test/server_test.js
index 9c7bb465aa..a9df43909e 100644
--- a/src/node/test/server_test.js
+++ b/src/node/test/server_test.js
@@ -59,16 +59,11 @@ describe('server', function() {
it('should bind to an unused port', function() {
var port;
assert.doesNotThrow(function() {
- port = server.addHttp2Port('0.0.0.0:0');
+ port = server.addHttp2Port('0.0.0.0:0',
+ grpc.ServerCredentials.createInsecure());
});
assert(port > 0);
});
- });
- describe('addSecureHttp2Port', function() {
- var server;
- before(function() {
- server = new grpc.Server();
- });
it('should bind to an unused port with ssl credentials', function() {
var port;
var key_path = path.join(__dirname, '../test/data/server1.key');
@@ -77,16 +72,22 @@ describe('server', function() {
var pem_data = fs.readFileSync(pem_path);
var creds = grpc.ServerCredentials.createSsl(null, key_data, pem_data);
assert.doesNotThrow(function() {
- port = server.addSecureHttp2Port('0.0.0.0:0', creds);
+ port = server.addHttp2Port('0.0.0.0:0', creds);
});
assert(port > 0);
});
});
+ describe('addSecureHttp2Port', function() {
+ var server;
+ before(function() {
+ server = new grpc.Server();
+ });
+ });
describe('listen', function() {
var server;
before(function() {
server = new grpc.Server();
- server.addHttp2Port('0.0.0.0:0');
+ server.addHttp2Port('0.0.0.0:0', grpc.ServerCredentials.createInsecure());
});
after(function() {
server.shutdown();