4 HAZİRAN 2012, PAZARTESİ
Kendinden imzalı https ile node.js ssl sertifika geçersiz görmezden.istek?
Yerel kablosuz yönlendirici (Cisco) kaydeder küçük bir uygulama üzerinde çalışıyorum ama yönlendirici kendinden imzalı ssl sertifikası ile bir sorun haline çalıştırıyorum.
Wget 192.168.1.1 yaptım ve almak:
ERROR: cannot verify 192.168.1.1's certificate, issued by `/C=US/ST=California/L=Irvine/O=Cisco-Linksys, LLC/OU=Division/CN=Linksys/emailAddress=support@linksys.com':
Self-signed certificate encountered.
ERROR: certificate common name `Linksys' doesn't match requested host name `192.168.1.1'.
To connect to 192.168.1.1 insecurely, use `--no-check-certificate'.
Düğüm, hata olur:
{ [Error: socket hang up] code: 'ECONNRESET' }
Geçerli örnek benim kod:
var req = https.request({
host: '192.168.1.1',
port: 443,
path: '/',
method: 'GET'
}, function(res){
var body = [];
res.on('data', function(data){
body.push(data);
});
res.on('end', function(){
console.log( body.join('') );
});
});
req.end();
req.on('error', function(err){
console.log(err);
});
Nasıl node.js eşdeğer yaptırmalıyız gidebilir miyim "--no-check-certificate"?
CEVAP
14 HAZİRAN 2012, PERŞEMBE
Talep seçenekleri, aşağıdaki gibi deneyin:
var req = https.request({
host: '192.168.1.1',
port: 443,
path: '/',
method: 'GET',
rejectUnauthorized: false,
requestCert: true,
agent: false
},
Bunu PaylaÅŸ:
Nasıl openssl ile kendinden imzalı bir...
Kendinden imzalı kabul alma Krom serti...
Nasıl bir Java HttpsURLConnection ile ...
kabul etmek için söylüyorum java kendi...
HTTPS ve SSL3_GET_SERVER_CERTİFİCATE:s...