From e57edc5a5827fcd111db229203416d6701dcde52 Mon Sep 17 00:00:00 2001 From: imaginos Date: Sat, 23 Apr 2005 05:44:42 +0000 Subject: [PATCH] woops, created a req, needed to create a signed cert git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@162 726aef4b-f618-498e-8847-2d620e286838 --- Utils.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Utils.cpp b/Utils.cpp index d95decaf..6f99e282 100644 --- a/Utils.cpp +++ b/Utils.cpp @@ -75,7 +75,13 @@ void CUtils::GenerateCert( FILE *pOut, bool bEncPrivKey ) { X509_REQ_set_subject_name( pReq, pName ); X509_REQ_sign( pReq, pKey, EVP_md5() ); - PEM_write_X509_REQ( pOut, pReq ); + X509 *pX509 = X509_REQ_to_X509( pReq, 365, pKey ); + if ( pX509 ) + { + PEM_write_X509( pOut, pX509 ); + X509_free( pX509 ); + } + X509_REQ_free( pReq ); EVP_PKEY_free( pKey ); };