File tree 4 files changed +21
-0
lines changed
4 files changed +21
-0
lines changed Original file line number Diff line number Diff line change 32
32
#include < stdio.h>
33
33
#include < string.h>
34
34
35
+ #ifndef CONF_NO_TLS
35
36
#include < openssl/ssl.h>
36
37
#include < openssl/err.h>
38
+ #endif
37
39
38
40
// Do a press any key for the windows folk. *insert any key joke here*
39
41
#ifdef _WIN32
@@ -54,12 +56,14 @@ void do_benchmark();
54
56
55
57
int main (int argc, char *argv[])
56
58
{
59
+ #ifndef CONF_NO_TLS
57
60
SSL_library_init ();
58
61
SSL_load_error_strings ();
59
62
ERR_load_BIO_strings ();
60
63
ERR_load_crypto_strings ();
61
64
SSL_load_error_strings ();
62
65
OpenSSL_add_all_digests ();
66
+ #endif
63
67
64
68
const char * sFilename = " config.txt" ;
65
69
bool benchmark_mode = false ;
Original file line number Diff line number Diff line change @@ -423,6 +423,15 @@ bool jconf::parse_config(const char* sFilename)
423
423
return false ;
424
424
}
425
425
426
+ #ifdef CONF_NO_TLS
427
+ if (prv->configValues [bTlsMode]->GetBool ())
428
+ {
429
+ printer::inst ()->print_msg (L0,
430
+ " Invalid config file. TLS enabled while the application has been compiled without TLS support." );
431
+ return false ;
432
+ }
433
+ #endif // CONF_NO_TLS
434
+
426
435
#ifdef _WIN32
427
436
if (GetSlowMemSetting () == no_mlck)
428
437
{
Original file line number Diff line number Diff line change @@ -103,10 +103,14 @@ jpsock::jpsock(size_t id, bool tls) : pool_id(id)
103
103
104
104
prv = new opaque_private (bJsonCallMem, bJsonRecvMem, bJsonParseMem);
105
105
106
+ #ifndef CONF_NO_TLS
106
107
if (tls)
107
108
sck = new tls_socket (this );
108
109
else
109
110
sck = new plain_socket (this );
111
+ #else
112
+ sck = new plain_socket (this );
113
+ #endif
110
114
111
115
oRecvThd = nullptr ;
112
116
bRunning = false ;
Original file line number Diff line number Diff line change 27
27
#include " console.h"
28
28
#include " executor.h"
29
29
30
+ #ifndef CONF_NO_TLS
30
31
#include < openssl/ssl.h>
31
32
#include < openssl/err.h>
32
33
#include < openssl/opensslconf.h>
33
34
34
35
#ifndef OPENSSL_THREADS
35
36
#error OpenSSL was compiled without thread support
36
37
#endif
38
+ #endif
37
39
38
40
plain_socket::plain_socket (jpsock* err_callback) : pCallback(err_callback)
39
41
{
@@ -166,6 +168,7 @@ void plain_socket::close(bool free)
166
168
}
167
169
}
168
170
171
+ #ifndef CONF_NO_TLS
169
172
tls_socket::tls_socket (jpsock* err_callback) : pCallback(err_callback)
170
173
{
171
174
}
@@ -355,4 +358,5 @@ void tls_socket::close(bool free)
355
358
bio = nullptr ;
356
359
}
357
360
}
361
+ #endif
358
362
You can’t perform that action at this time.
0 commit comments