update doc, bugfix for certMgr

This commit is contained in:
OttoMao
2014-11-13 10:05:56 +08:00
parent 0e387382c8
commit 7c5f9f72af
4 changed files with 14 additions and 7 deletions

View File

@@ -14,12 +14,17 @@ var certDir = path.join(util.getUserHome(),"/.anyproxy_certs/"),
cmd_genCert = path.join(cmdDir,"./gen-cer"),
asyncTaskMgr = new asyncTask();
if(!fs.existsSync(certDir)){
fs.mkdirSync(certDir,0777);
try{
fs.mkdirSync(certDir,0777); //may fail in windows
}catch(e){
console.log("===========");
console.log("failed to create cert dir ,please create one by yourself - " + certDir);
console.log("this error will not block main thread unless you use https-related features in anyproxy");
console.log("===========");
}
}
function getCertificate(hostname,cb){
var keyFile = path.join(certDir , "__hostname.key".replace(/__hostname/,hostname) ),
crtFile = path.join(certDir , "__hostname.crt".replace(/__hostname/,hostname) );