mirror of
https://github.com/alibaba/anyproxy.git
synced 2025-07-29 09:27:42 +00:00
add download link for rootCA.crt, bugfix
This commit is contained in:
@@ -72,7 +72,7 @@ function checkRootCA(){
|
||||
if(!isRootCAFileExists()){
|
||||
console.log(color.red("can not find rootCA.crt or rootCA.key"));
|
||||
console.log(color.red("you may generate one by the following methods"));
|
||||
console.log(color.red("\twhen using globally : sudo anyproxy --root"));
|
||||
console.log(color.red("\twhen using globally : anyproxy --root"));
|
||||
console.log(color.red("\twhen using as a module : require(\"anyproxy\").generateRootCA();"));
|
||||
process.exit(0);
|
||||
}
|
||||
@@ -110,6 +110,7 @@ function generateRootCA(){
|
||||
if(code == 0){
|
||||
console.log(color.green("rootCA generated"));
|
||||
console.log(color.green(color.bold("please trust the rootCA.crt in " + certDir)));
|
||||
console.log(color.green(color.bold("or you may get it via anyproxy webinterface")));
|
||||
process.exit(0);
|
||||
}else{
|
||||
console.log(color.red("fail to generate root CA"));
|
||||
@@ -120,6 +121,16 @@ function generateRootCA(){
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function getRootCAFilePath(){
|
||||
if(isRootCAFileExists()){
|
||||
return path.join(certDir,"rootCA.crt");
|
||||
}else{
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
module.exports.getRootCAFilePath = getRootCAFilePath;
|
||||
module.exports.generateRootCA = generateRootCA;
|
||||
module.exports.getCertificate = getCertificate;
|
||||
module.exports.createCert = createCert;
|
||||
|
Reference in New Issue
Block a user