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

chapter4

Open nangua509 opened this issue 6 years ago • 3 comments

hello,我试着跑了一个chapter4的代码,碰到了以前错误,请问是什么情况? CONNECT v10.events.data.microsoft.com:443 _tls_common.js:61 throw new ERR_INVALID_ARG_TYPE( ^

TypeError [ERR_INVALID_ARG_TYPE]: The "options.cert" property must be one of type string, Buffer, TypedArray, or DataView. Received type object at validateKeyCert (_tls_common.js:61:11) at Object.createSecureContext (_tls_common.js:122:7) at Server (_tls_wrap.js:867:27) at new Server (https.js:62:14) at createFakeHttpsWebSite (C:\Users\Administrator\Desktop\code\https-mitm-proxy-handbook\code\chapter4\createFakeHttpsWebSite.js:41:22) at Server.httpTunnel.on (C:\Users\Administrator\Desktop\code\https-mitm-proxy-handbook\code\chapter4\simpleHttpsProxy.js:34:3) at Server.emit (events.js:182:13) at onParserExecuteCommon (_http_server.js:535:14) at onParserExecute (_http_server.js:482:3)

在44行加了打印,并没有打印出来

SNICallback: (hostname, done) => { console.log(123) let certObj = createFakeCertificateByDomain(caKey, caCert, hostname) console.log(certObj);

我run在windows环境上 $ node -v v10.8.0

nangua509 avatar Aug 30 '18 15:08 nangua509

你可以参照第三节,可以发现他在创建伪https站点的时候,传入的cert参数没有通过pki.certificateToPem方法转换,key也是。转换一下就可以了

RonnieDuck avatar Sep 17 '19 07:09 RonnieDuck

你可以参照第三节,可以发现他在创建伪https站点的时候,传入的cert参数没有通过pki.certificateToPem方法转换,key也是。转换一下就可以了

转换一下确实不报错了,但是打开https://www.baidu.com,请求貌似没有发出去。

akzhou avatar Jan 02 '20 12:01 akzhou

node 降级到 6 试试

Camusama avatar Aug 27 '23 10:08 Camusama