]> granicus.if.org Git - icinga2/commitdiff
Set correct X509 version for certificates
authorGunnar Beutner <gunnar@beutner.name>
Wed, 29 Jul 2015 10:59:12 +0000 (12:59 +0200)
committerGunnar Beutner <gunnar@beutner.name>
Wed, 29 Jul 2015 10:59:12 +0000 (12:59 +0200)
fixes #9769

lib/base/tlsutility.cpp

index bba952a116099841f66a8fa57e61feda54f09e33..3d5c8fe92e7c0da4fc1b9c2ca4176b79e1091db4 100644 (file)
@@ -371,6 +371,7 @@ int MakeX509CSR(const String& cn, const String& keyfile, const String& csrfile,
 boost::shared_ptr<X509> CreateCert(EVP_PKEY *pubkey, X509_NAME *subject, X509_NAME *issuer, EVP_PKEY *cakey, bool ca, const String& serialfile)
 {
        X509 *cert = X509_new();
+       X509_set_version(cert, 2);
        X509_gmtime_adj(X509_get_notBefore(cert), 0);
        X509_gmtime_adj(X509_get_notAfter(cert), 365 * 24 * 60 * 60 * 30);
        X509_set_pubkey(cert, pubkey);