std::unordered_map<std::string, std::shared_ptr<CAConfig>> CAs;
std::string sqlHost, sqlUser, sqlPass, sqlDB;
std::string serialPath;
+std::string crlPrefix;
+std::string crtPrefix;
std::shared_ptr<std::unordered_map<std::string, std::string>> parseConf( std::string path ) {
- std::shared_ptr<std::unordered_map<std::string, std::string>> map( new std::unordered_map<std::string, std::string>() );
+ auto map = std::make_shared<std::unordered_map<std::string, std::string>>();
std::ifstream config;
config.open( path );
if( !config.is_open() ) {
logger::notef( "Where is \"%s\"?", path );
- throw "Config missing";
+ throw std::runtime_error("Config missing");
}
std::string line1;
}
if( CAs.find( caName ) == CAs.end() ) {
- std::shared_ptr<CAConfig> ca( new CAConfig( caName ) );
+ auto ca = std::make_shared<CAConfig>( caName );
CAs.emplace( caName, ca );
}
closedir( dir );
} else {
- throw "Directory with CAConfigs not found";
+ throw std::runtime_error("Directory with CAConfigs not found");
}
profiles.emplace( profileName, prof );
sqlPass = masterConf->at( "sql.password" );
sqlDB = masterConf->at( "sql.database" );
serialPath = masterConf->at( "serialPath" );
+ crlPrefix = masterConf->at( "crlPrefix" );
+ crtPrefix = masterConf->at( "crtPrefix" );
if( keyDir == "" ) {
logger::error( "Missing config property key.directory" );