Kendinden imzalı https ile node.js ssl sertifika geçersiz görmezden.istek? | Netgez.com
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

  • Electro Posé

    Electro PosÃ

    21 ÅžUBAT 2013
  • Study with Substance P

    Study with S

    31 Mayıs 2008
  • The Onion

    The Onion

    14 Mart 2006