Skip to content

Commit 7c551bf

Browse files
committed
tests: fix tls tests and enable stunnel tests for travis
1 parent fbdac9e commit 7c551bf

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

test/tls.spec.js

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,13 @@ var tls_port = 6380;
1919
// Use skip instead of returning to indicate what tests really got skipped
2020
var skip = false;
2121

22-
// Wait until stunnel4 is in the travis whitelist
23-
// Check: https://github.com/travis-ci/apt-package-whitelist/issues/403
24-
// If this is merged, remove the travis env checks
2522
describe('TLS connection tests', function () {
2623

2724
before(function (done) {
2825
// Print the warning when the tests run instead of while starting mocha
2926
if (process.platform === 'win32') {
3027
skip = true;
3128
console.warn('\nStunnel tests do not work on windows atm. If you think you can fix that, it would be warmly welcome.\n');
32-
} else if (process.env.TRAVIS === 'true') {
33-
skip = true;
34-
console.warn('\nTravis does not support stunnel right now. Skipping tests.\nCheck: https://github.com/travis-ci/apt-package-whitelist/issues/403\n');
3529
}
3630
if (skip) return done();
3731
helper.stopStunnel(function () {
@@ -58,7 +52,7 @@ describe('TLS connection tests', function () {
5852
client = redis.createClient({
5953
connect_timeout: connect_timeout,
6054
port: tls_port,
61-
tls: tls_options
55+
tls: utils.clone(tls_options)
6256
});
6357
var time = 0;
6458
assert.strictEqual(client.address, '127.0.0.1:' + tls_port);
@@ -109,12 +103,14 @@ describe('TLS connection tests', function () {
109103
client.get('foo', helper.isString('bar', done));
110104
});
111105

112-
describe('using rediss as url protocol', function (done) {
106+
describe('using rediss as url protocol', function () {
113107
var tls_connect = tls.connect;
114108
beforeEach(function () {
115109
tls.connect = function (options) {
116110
options = utils.clone(options);
117111
options.ca = tls_options.ca;
112+
options.servername = 'redis.js.org';
113+
options.rejectUnauthorized = true;
118114
return tls_connect.call(tls, options);
119115
};
120116
});

0 commit comments

Comments
 (0)