Commit 6971508e authored by antoor's avatar antoor

Add ignore HTTPS Certificate features

增加忽略HTTPS证书功能
parent 4b765483
...@@ -589,6 +589,16 @@ Request.prototype.ca = function(cert){ ...@@ -589,6 +589,16 @@ Request.prototype.ca = function(cert){
return this; return this;
}; };
/**
* 忽略HTTPS证书
* @param {[type]} ignore [description]
* @return {[type]} [description]
*/
Request.prototype.ignoreHttps = function(ignore) {
this._ignoreHttps = ignore || false;
return this;
};
/** /**
* Return an http[s] request. * Return an http[s] request.
* *
...@@ -615,6 +625,7 @@ Request.prototype.request = function(){ ...@@ -615,6 +625,7 @@ Request.prototype.request = function(){
options.host = url.hostname; options.host = url.hostname;
options.ca = this._ca; options.ca = this._ca;
options.agent = this._agent; options.agent = this._agent;
options.requestCert = this._ignoreHttps;
// initiate request // initiate request
var mod = exports.protocols[url.protocol]; var mod = exports.protocols[url.protocol];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment