4
4
5
5
#include < cstdio>
6
6
#include < fcntl.h>
7
- #include < time.h >
7
+ #include < ctime >
8
8
#include < openssl/ssl.h>
9
9
10
10
#include < client/updateSelectParms.h>
@@ -53,7 +53,9 @@ static void init_ssl_library()
53
53
UDA_LOG (UDA_LOG_DEBUG, " Prior SSL initialisation\n " );
54
54
return ;
55
55
}
56
- OPENSSL_init_ssl (OPENSSL_INIT_SSL_DEFAULT, nullptr );
56
+ SSL_library_init ();
57
+ SSL_load_error_strings ();
58
+ OpenSSL_add_ssl_algorithms ();
57
59
#ifdef _WIN32
58
60
if (getenv (" UDA_SSL_INITIALISED" ) == nullptr ) {
59
61
_putenv_s (" UDA_SSL_INITIALISED" , " 1" );
@@ -271,8 +273,8 @@ int configureUdaClientSSLContext(const HostData* host)
271
273
UDA_THROW_ERROR (999 , " Unable to parse client certificate [%s] to verify certificate validity" );
272
274
}
273
275
274
- const ASN1_TIME* before = X509_getm_notBefore (clientCert);
275
- const ASN1_TIME* after = X509_getm_notAfter (clientCert);
276
+ const ASN1_TIME* before = X509_get_notBefore (clientCert);
277
+ const ASN1_TIME* after = X509_get_notAfter (clientCert);
276
278
277
279
char work[X509_STRING_SIZE];
278
280
UDA_LOG (UDA_LOG_DEBUG, " Client X509 subject: %s\n " ,
@@ -383,7 +385,7 @@ int startUdaClientSSL()
383
385
}
384
386
385
387
// Get the Server certificate and verify
386
- X509* peer = SSL_get1_peer_certificate (g_ssl);
388
+ X509* peer = SSL_get_peer_certificate (g_ssl);
387
389
388
390
if (peer != nullptr ) {
389
391
@@ -406,8 +408,8 @@ int startUdaClientSSL()
406
408
407
409
// Verify Date validity
408
410
409
- const ASN1_TIME* before = X509_getm_notBefore (peer);
410
- const ASN1_TIME* after = X509_getm_notAfter (peer);
411
+ const ASN1_TIME* before = X509_get_notBefore (peer);
412
+ const ASN1_TIME* after = X509_get_notAfter (peer);
411
413
412
414
time_t current_time = time (nullptr );
413
415
char * c_time_string = ctime (¤t_time);
0 commit comments