diff options
author | Ben Noordhuis <info@bnoordhuis.nl> | 2012-08-30 16:43:20 +0200 |
---|---|---|
committer | Ben Noordhuis <info@bnoordhuis.nl> | 2012-09-15 00:19:30 +0200 |
commit | 3806cf0d640da3024d50208452d2dd9e3cb015d2 (patch) | |
tree | 846352a0e26e9d58ac529c127c7d72cce34ae4c9 /test/pummel | |
parent | 35607f3a2dda03af8cf2dd3704c0c915e28aa774 (diff) | |
download | nodejs-3806cf0d640da3024d50208452d2dd9e3cb015d2.tar.gz nodejs-3806cf0d640da3024d50208452d2dd9e3cb015d2.tar.bz2 nodejs-3806cf0d640da3024d50208452d2dd9e3cb015d2.zip |
test: set rejectUnauthorized in tls/https tests
Update the tls and https tests to explicitly set rejectUnauthorized instead of
relying on the NODE_TLS_REJECT_UNAUTHORIZED environment variable getting set.
Diffstat (limited to 'test/pummel')
-rw-r--r-- | test/pummel/test-https-large-response.js | 8 | ||||
-rw-r--r-- | test/pummel/test-tls-throttle.js | 8 |
2 files changed, 8 insertions, 8 deletions
diff --git a/test/pummel/test-https-large-response.js b/test/pummel/test-https-large-response.js index 23a836081..370415dcb 100644 --- a/test/pummel/test-https-large-response.js +++ b/test/pummel/test-https-large-response.js @@ -19,9 +19,6 @@ // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. -// disable strict server certificate validation by the client -process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0'; - var common = require('../common'); var assert = require('assert'); @@ -53,7 +50,10 @@ var count = 0; var gotResEnd = false; server.listen(common.PORT, function() { - https.get({ port: common.PORT }, function(res) { + https.get({ + port: common.PORT, + rejectUnauthorized: false + }, function(res) { console.log('response!'); res.on('data', function(d) { diff --git a/test/pummel/test-tls-throttle.js b/test/pummel/test-tls-throttle.js index cfe7d737f..a7119944a 100644 --- a/test/pummel/test-tls-throttle.js +++ b/test/pummel/test-tls-throttle.js @@ -22,9 +22,6 @@ // Server sends a large string. Client counts bytes and pauses every few // seconds. Makes sure that pause and resume work properly. -// disable strict server certificate validation by the client -process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0'; - var common = require('../common'); var assert = require('assert'); var tls = require('tls'); @@ -56,7 +53,10 @@ var server = tls.Server(options, function(socket) { var recvCount = 0; server.listen(common.PORT, function() { - var client = tls.connect(common.PORT); + var client = tls.connect({ + port: common.PORT, + rejectUnauthorized: false + }); client.on('data', function(d) { process.stdout.write('.'); |