https-mitm-proxy-handbook icon indicating copy to clipboard operation
https-mitm-proxy-handbook copied to clipboard

中间人对HTTPS只能伪造吗,要怎么样才能获取到HTTPS的响应HTML?

Open dabpop139 opened this issue 7 years ago • 0 comments

在代码Chapter4中只实现了返回伪造的响应内容,要如何才能获取到真实请求地址的响应HTML代码呢? 如果可以希望你指点一下,非常感谢。 还有一处疑问,为什么这在SNICallback回调中又要重新再生成一次证书呢?不能直接使用上文的fakeCertObj证书吗?

var fakeServer = new https.Server({
    key: fakeCertObj.key,
    cert: fakeCertObj.cert,
    SNICallback: (hostname, cback) => {
        let certObj = createFakeCertificateByDomain(caKey, caCert, hostname);
        cback(null, tls.createSecureContext({
            key: pki.privateKeyToPem(certObj.key),
            cert: pki.certificateToPem(certObj.cert)
        }));
    }
});

dabpop139 avatar Sep 14 '18 13:09 dabpop139