Stop asking for the host name in --makepem

Come on, it's a self-signed certificate, how much value does it have anyway?
Also, it gets rid of a question during --makeconf which confuses some people.

This should now use $HOSTNAME and fall back to "host.unknown" if that isn't set.

Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
Uli Schlachter
2011-08-03 22:05:21 +02:00
parent 90f741d2ca
commit dcf357b1f6
2 changed files with 2 additions and 15 deletions
+1 -14
View File
@@ -282,19 +282,6 @@ bool CZNC::WritePemFile() {
return false;
#else
CString sPemFile = GetPemLocation();
const char* pHostName = getenv("HOSTNAME");
CString sHost;
if (pHostName) {
sHost = pHostName;
}
if (CFile::Exists(sPemFile)) {
CUtils::PrintError("Pem file [" + sPemFile + "] already exists");
return false;
}
while (!CUtils::GetInput("hostname of your shell", sHost, sHost, "including the '.com' portion")) ;
CUtils::PrintAction("Writing Pem file [" + sPemFile + "]");
FILE *f = fopen(sPemFile.c_str(), "w");
@@ -304,7 +291,7 @@ bool CZNC::WritePemFile() {
return false;
}
CUtils::GenerateCert(f, sHost);
CUtils::GenerateCert(f, "");
fclose(f);
CUtils::PrintStatus(true);