Browse Source

Merge branch '1.7.x'

master
Alexey Sokolov 3 years ago
parent
commit
f3eca21bae
2 changed files with 7 additions and 3 deletions
  1. +1
    -1
      configure.ac
  2. +6
    -2
      src/Utils.cpp

+ 1
- 1
configure.ac View File

@ -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
src/Utils.cpp View File

@ -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());


Loading…
Cancel
Save