From: Michael Friedrich Date: Fri, 26 May 2017 11:16:20 +0000 (+0200) Subject: Build fix for OpenSSL 0.9.8 and stack_st_X509_EXTENSION X-Git-Tag: v2.7.0~53^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=refs%2Fpull%2F5292%2Fhead;p=icinga2 Build fix for OpenSSL 0.9.8 and stack_st_X509_EXTENSION --- diff --git a/lib/base/tlsutility.cpp b/lib/base/tlsutility.cpp index bf5b5a4be..f651d63fe 100644 --- a/lib/base/tlsutility.cpp +++ b/lib/base/tlsutility.cpp @@ -409,7 +409,8 @@ int MakeX509CSR(const String& cn, const String& keyfile, const String& csrfile, String san = "DNS:" + cn; X509_EXTENSION *subjectAltNameExt = X509V3_EXT_conf_nid(NULL, NULL, NID_subject_alt_name, const_cast(san.CStr())); if (subjectAltNameExt) { - stack_st_X509_EXTENSION *exts = sk_X509_EXTENSION_new_null(); + /* OpenSSL 0.9.8 requires STACK_OF(X509_EXTENSION), otherwise we would just use stack_st_X509_EXTENSION. */ + STACK_OF(X509_EXTENSION) *exts = sk_X509_EXTENSION_new_null(); sk_X509_EXTENSION_push(exts, subjectAltNameExt); X509_REQ_add_extensions(req, exts); sk_X509_EXTENSION_pop_free(exts, X509_EXTENSION_free);