mirror of
https://github.com/znc/znc.git
synced 2026-08-06 17:03:14 +02:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user