From 0b495d1858b3364c66d582cff552ae7bda619a34 Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Wed, 29 Jul 2015 12:59:12 +0200 Subject: [PATCH] Set correct X509 version for certificates fixes #9769 --- lib/base/tlsutility.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/base/tlsutility.cpp b/lib/base/tlsutility.cpp index bba952a11..3d5c8fe92 100644 --- a/lib/base/tlsutility.cpp +++ b/lib/base/tlsutility.cpp @@ -371,6 +371,7 @@ int MakeX509CSR(const String& cn, const String& keyfile, const String& csrfile, boost::shared_ptr 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);