diff --git a/lib/browserid-local-verify.js b/lib/browserid-local-verify.js index 39416d4..7f5620d 100644 --- a/lib/browserid-local-verify.js +++ b/lib/browserid-local-verify.js @@ -12,7 +12,8 @@ function Verifier(args) { this.args = _.extend({ 'maxDelegations': 5, 'httpTimeout': 10.0, - 'insecureSSL': false + 'insecureSSL': false, + 'forceInsecureLookupOverHTTP': false }, args); } diff --git a/lib/lookup.js b/lib/lookup.js index c64a570..90e5787 100644 --- a/lib/lookup.js +++ b/lib/lookup.js @@ -19,7 +19,8 @@ const DEFAULT_PORTS = { // like https.get() but transparently supports the // $https_proxy and $no_proxy environment variables. var getWithTransparentProxying = function(options, cb) { - var httpmod = https; + options = options || {}; + var httpmod = options.httpmod || https; var proxy = shouldUseProxy(options.host); if (proxy) { if (proxy.scheme === 'http') { @@ -130,6 +131,7 @@ var fetchWellKnown = function (emitter, args, currentDomain, principalDomain, cl port: port, path: pathToWellKnown, rejectUnauthorized: !args.insecureSSL, + httpmod: (!! args.forceInsecureLookupOverHTTP) ? http : https, agent: false }, function(res) { var body = "";