diff --git a/src/puppet-web/browser.js b/src/puppet-web/browser.js index 406f3814a9dd3f392dfac3f7e6a01f8f35bf1453..17a3ea5fc500faf7becb90beb45de6cfc3ef54a0 100644 --- a/src/puppet-web/browser.js +++ b/src/puppet-web/browser.js @@ -112,6 +112,11 @@ class Browser extends EventEmitter { , '--ignore-ssl-errors=true' // this help socket.io connect with localhost , '--web-security=false' // https://github.com/ariya/phantomjs/issues/12440#issuecomment-52155299 , '--ssl-protocol=TLSv1' // https://github.com/ariya/phantomjs/issues/11239#issuecomment-42362211 + + // issue: Secure WebSocket(wss) do not work with Self Signed Certificate in PhantomJS #12 + // , '--ssl-certificates-path=D:\\cygwin64\\home\\zixia\\git\\wechaty' // http://stackoverflow.com/a/32690349/1123955 + // , '--ssl-client-certificate-file=cert.pem' // + ] if (process.env.WECHATY_DEBUG) { phantomjsArgs.push('--remote-debugger-port=8080') // XXX: be careful when in production env. diff --git a/src/puppet-web/ssl-pem.js b/src/puppet-web/ssl-pem.js index 61138e2a836eafd5d291c6bae09b760a497fddef..06e0f0249bf5d585d2150347b0ae2963b434e50e 100644 --- a/src/puppet-web/ssl-pem.js +++ b/src/puppet-web/ssl-pem.js @@ -6,8 +6,11 @@ * so it will not be a security issue. * * http://blog.mgechev.com/2014/02/19/create-https-tls-ssl-application-with-express-nodejs/ - * openssl req -x509 -newkey rsa:2048 -keyout key.pem -out cert.pem -days 365 + * openssl req -x509 -days 3650 -nodes -newkey rsa:2048 -keyout key.pem -out cert.pem * openssl rsa -in key.pem -out newkey.pem && mv newkey.pem key.pem + * + * Reference: + * What is a Pem file - http://serverfault.com/a/9717 */ const key = ` -----BEGIN RSA PRIVATE KEY-----