mirror of
https://github.com/znc/znc.git
synced 2026-08-08 09:52:55 +02:00
Fix compilation without deprecated APIs in OpenSSL 1.1
Prior commit was tested with 1.0.2. This one with 1.1.
This commit is contained in:
+1
-1
@@ -370,7 +370,7 @@ if test "x$SSL" != "xno"; then
|
||||
#include <openssl/ssl.h>
|
||||
#include <openssl/dh.h>
|
||||
]], [[
|
||||
SSL_CTX* ctx = SSL_CTX_new(TLSv1_method());
|
||||
SSL_CTX* ctx = SSL_CTX_new(SSLv23_method());
|
||||
SSL* ssl = SSL_new(ctx);
|
||||
DH* dh = DH_new();
|
||||
DH_free(dh);
|
||||
|
||||
+6
-2
@@ -29,6 +29,10 @@
|
||||
#include <openssl/ssl.h>
|
||||
#include <openssl/bn.h>
|
||||
#include <openssl/rsa.h>
|
||||
#if OPENSSL_VERSION_NUMBER < 0x10100000L
|
||||
#define X509_getm_notBefore X509_get_notBefore
|
||||
#define X509_getm_notAfter X509_get_notAfter
|
||||
#endif
|
||||
#endif /* HAVE_LIBSSL */
|
||||
#include <memory>
|
||||
#include <unistd.h>
|
||||
@@ -95,8 +99,8 @@ void CUtils::GenerateCert(FILE* pOut, const CString& sHost) {
|
||||
|
||||
X509_set_version(pCert.get(), 2);
|
||||
ASN1_INTEGER_set(X509_get_serialNumber(pCert.get()), serial);
|
||||
X509_gmtime_adj(X509_get_notBefore(pCert.get()), 0);
|
||||
X509_gmtime_adj(X509_get_notAfter(pCert.get()),
|
||||
X509_gmtime_adj(X509_getm_notBefore(pCert.get()), 0);
|
||||
X509_gmtime_adj(X509_getm_notAfter(pCert.get()),
|
||||
(long)60 * 60 * 24 * days * years);
|
||||
X509_set_pubkey(pCert.get(), pKey.get());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user