Added prompt for pem file generation
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@557 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
1 parent
e3b723de5b
commit
bf1715973b
5 files changed
+46
-44
No files matched your search
@@ -41,7 +41,7 @@ char *strcasestr(const char *big, const char *little) {
|
||||
#endif /* __sun */
|
||||
|
||||
#ifdef HAVE_LIBSSL
|
||||
void CUtils::GenerateCert(FILE *pOut, bool bEncPrivKey) {
|
||||
void CUtils::GenerateCert(FILE *pOut, bool bEncPrivKey, const CString& sHost) {
|
||||
EVP_PKEY *pKey = NULL;
|
||||
X509 *pCert = NULL;
|
||||
X509_NAME *pName = NULL;
|
||||
@@ -72,8 +72,16 @@ void CUtils::GenerateCert(FILE *pOut, bool bEncPrivKey) {
|
||||
|
||||
pName = X509_get_subject_name( pCert );
|
||||
|
||||
char *pLogName = getenv("LOGNAME");
|
||||
char *pHostName = getenv("HOSTNAME");
|
||||
const char *pLogName = getenv("LOGNAME");
|
||||
const char *pHostName = NULL;
|
||||
|
||||
if (!sHost.empty()) {
|
||||
pHostName = sHost.c_str();
|
||||
}
|
||||
|
||||
if (!pHostName) {
|
||||
pHostName = getenv("HOSTNAME");
|
||||
}
|
||||
|
||||
if (!pLogName) {
|
||||
pLogName = "Unknown";
|
||||
|
||||
Reference in new issue
Block a user