SORU
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ş:
  • Google+
  • E-Posta
Etiketler:

YORUMLAR

SPONSOR VİDEO

Rastgele Yazarlar

  • FD2097

    FD2097

    21 HAZİRAN 2009
  • julioissk84life

    julioissk84l

    18 ŞUBAT 2008
  • Snazzy Labs

    Snazzy Labs

    9 Aralık 2008