test
This commit is contained in:
		
							parent
							
								
									f9e269bfc2
								
							
						
					
					
						commit
						7a93c3d793
					
				@ -4090,7 +4090,8 @@ var originalCas = [
 | 
			
		||||
  "m+kXQ99b21/+jh5Xos1AnX5iItreGCc=\n" +
 | 
			
		||||
  "-----END CERTIFICATE-----\n"
 | 
			
		||||
];
 | 
			
		||||
module.exports.rootCas = module.exports = originalCas.slice(0);
 | 
			
		||||
module.exports = originalCas.slice(0);
 | 
			
		||||
module.exports.rootCas = module.exports;
 | 
			
		||||
module.exports.rootCas.inject = function (/*context*/) {
 | 
			
		||||
  var rootCas = this || module.exports.rootCas;
 | 
			
		||||
  var opts = /*context ||*/ require('https').globalAgent.options;
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										51
									
								
								test.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										51
									
								
								test.js
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,51 @@
 | 
			
		||||
'use strict';
 | 
			
		||||
 | 
			
		||||
testDefault();
 | 
			
		||||
 | 
			
		||||
// backwards compat
 | 
			
		||||
function testDefault() {
 | 
			
		||||
  require('https').globalAgent.options.ca = null;
 | 
			
		||||
  var rootCas = require('./latest');
 | 
			
		||||
  var request = require('request');
 | 
			
		||||
 | 
			
		||||
  require('https').globalAgent.options.ca = rootCas;
 | 
			
		||||
  request.get('https://daplie.com/404.html', function (err, resp, body) {
 | 
			
		||||
    if (err) {
 | 
			
		||||
      throw err;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    testInject();
 | 
			
		||||
  });
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function testInject() {
 | 
			
		||||
  require('https').globalAgent.options.ca = null;
 | 
			
		||||
  var rootCas = require('./latest').inject();
 | 
			
		||||
  var request = require('request');
 | 
			
		||||
 | 
			
		||||
  require('https').globalAgent.options.ca = rootCas;
 | 
			
		||||
  request.get('https://daplie.com/404.html', function (err, resp, body) {
 | 
			
		||||
    if (err) {
 | 
			
		||||
      throw err;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    testCreate();
 | 
			
		||||
  });
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function testCreate() {
 | 
			
		||||
  require('https').globalAgent.options.ca = null;
 | 
			
		||||
  var rootCas = require('./latest').create();
 | 
			
		||||
  var request = require('request');
 | 
			
		||||
 | 
			
		||||
  require('https').globalAgent.options.ca = rootCas;
 | 
			
		||||
  request.get('https://daplie.com/404.html', function (err, resp, body) {
 | 
			
		||||
    if (err) {
 | 
			
		||||
      throw err;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    console.log(body);
 | 
			
		||||
  });
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// TODO test with a company certificate
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user