Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
Cryptocat.Pinning.get = function(url, callback) {
var domain = domains['crypto.cat'];
if (url.startsWith('https://download.crypto.cat/')) {
domain = domains['download.crypto.cat'];
}
var candidate = {};
var get = HTTPS.request({
hostname: domain[0].subject,
port: 443,
protocol: 'https:',
path: NodeUrl.parse(url).pathname,
agent: false
}, function(res) {
if (
(checkCert(candidate, domain[0])) ||
(checkCert(candidate, domain[1]))
) {
callback(res, true);
} else {
callback({}, false);