Ark Server API (ASE) - Wiki
Loading...
Searching...
No Matches
crypto.h
Go to the documentation of this file.
1/*
2 * Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved.
3 * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved
4 *
5 * Licensed under the OpenSSL license (the "License"). You may not use
6 * this file except in compliance with the License. You can obtain a copy
7 * in the file LICENSE in the source distribution or at
8 * https://www.openssl.org/source/license.html
9 */
10
11#ifndef HEADER_CRYPTO_H
12# define HEADER_CRYPTO_H
13
14# include <stdlib.h>
15# include <time.h>
16
17# include <openssl/e_os2.h>
18
19# ifndef OPENSSL_NO_STDIO
20# include <stdio.h>
21# endif
22
23# include <openssl/safestack.h>
24# include <openssl/opensslv.h>
25# include <openssl/ossl_typ.h>
26# include <openssl/opensslconf.h>
27# include <openssl/cryptoerr.h>
28
29# ifdef CHARSET_EBCDIC
30# include <openssl/ebcdic.h>
31# endif
32
33/*
34 * Resolve problems on some operating systems with symbol names that clash
35 * one way or another
36 */
37# include <openssl/symhacks.h>
38
39# if OPENSSL_API_COMPAT < 0x10100000L
40# include <openssl/opensslv.h>
41# endif
42
43#ifdef __cplusplus
44extern "C" {
45#endif
46
47# if OPENSSL_API_COMPAT < 0x10100000L
48# define SSLeay OpenSSL_version_num
49# define SSLeay_version OpenSSL_version
50# define SSLEAY_VERSION_NUMBER OPENSSL_VERSION_NUMBER
51# define SSLEAY_VERSION OPENSSL_VERSION
52# define SSLEAY_CFLAGS OPENSSL_CFLAGS
53# define SSLEAY_BUILT_ON OPENSSL_BUILT_ON
54# define SSLEAY_PLATFORM OPENSSL_PLATFORM
55# define SSLEAY_DIR OPENSSL_DIR
56
57/*
58 * Old type for allocating dynamic locks. No longer used. Use the new thread
59 * API instead.
60 */
61typedef struct {
62 int dummy;
63} CRYPTO_dynlock;
64
65# endif /* OPENSSL_API_COMPAT */
66
67typedef void CRYPTO_RWLOCK;
68
74
75int CRYPTO_atomic_add(int *val, int amount, int *ret, CRYPTO_RWLOCK *lock);
76
77/*
78 * The following can be used to detect memory leaks in the library. If
79 * used, it turns on malloc checking
80 */
81# define CRYPTO_MEM_CHECK_OFF 0x0 /* Control only */
82# define CRYPTO_MEM_CHECK_ON 0x1 /* Control and mode bit */
83# define CRYPTO_MEM_CHECK_ENABLE 0x2 /* Control and mode bit */
84# define CRYPTO_MEM_CHECK_DISABLE 0x3 /* Control only */
85
87 STACK_OF(void) *sk;
88};
90
91/*
92 * Per class, we have a STACK of function pointers.
93 */
94# define CRYPTO_EX_INDEX_SSL 0
95# define CRYPTO_EX_INDEX_SSL_CTX 1
96# define CRYPTO_EX_INDEX_SSL_SESSION 2
97# define CRYPTO_EX_INDEX_X509 3
98# define CRYPTO_EX_INDEX_X509_STORE 4
99# define CRYPTO_EX_INDEX_X509_STORE_CTX 5
100# define CRYPTO_EX_INDEX_DH 6
101# define CRYPTO_EX_INDEX_DSA 7
102# define CRYPTO_EX_INDEX_EC_KEY 8
103# define CRYPTO_EX_INDEX_RSA 9
104# define CRYPTO_EX_INDEX_ENGINE 10
105# define CRYPTO_EX_INDEX_UI 11
106# define CRYPTO_EX_INDEX_BIO 12
107# define CRYPTO_EX_INDEX_APP 13
108# define CRYPTO_EX_INDEX_UI_METHOD 14
109# define CRYPTO_EX_INDEX_DRBG 15
110# define CRYPTO_EX_INDEX__COUNT 16
111
112/* No longer needed, so this is a no-op */
113#define OPENSSL_malloc_init() while(0) continue
114
115int CRYPTO_mem_ctrl(int mode);
116
117# define OPENSSL_malloc(num)
118 CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
119# define OPENSSL_zalloc(num)
120 CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
121# define OPENSSL_realloc(addr, num)
122 CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
123# define OPENSSL_clear_realloc(addr, old_num, num)
124 CRYPTO_clear_realloc(addr, old_num, num, OPENSSL_FILE, OPENSSL_LINE)
125# define OPENSSL_clear_free(addr, num)
126 CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
127# define OPENSSL_free(addr)
128 CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
129# define OPENSSL_memdup(str, s)
130 CRYPTO_memdup((str), s, OPENSSL_FILE, OPENSSL_LINE)
131# define OPENSSL_strdup(str)
132 CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
133# define OPENSSL_strndup(str, n)
134 CRYPTO_strndup(str, n, OPENSSL_FILE, OPENSSL_LINE)
135# define OPENSSL_secure_malloc(num)
136 CRYPTO_secure_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
137# define OPENSSL_secure_zalloc(num)
138 CRYPTO_secure_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
139# define OPENSSL_secure_free(addr)
140 CRYPTO_secure_free(addr, OPENSSL_FILE, OPENSSL_LINE)
141# define OPENSSL_secure_clear_free(addr, num)
142 CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
143# define OPENSSL_secure_actual_size(ptr)
144 CRYPTO_secure_actual_size(ptr)
145
146size_t OPENSSL_strlcpy(char *dst, const char *src, size_t siz);
147size_t OPENSSL_strlcat(char *dst, const char *src, size_t siz);
148size_t OPENSSL_strnlen(const char *str, size_t maxlen);
149char *OPENSSL_buf2hexstr(const unsigned char *buffer, long len);
150unsigned char *OPENSSL_hexstr2buf(const char *str, long *len);
151int OPENSSL_hexchar2int(unsigned char c);
152
153# define OPENSSL_MALLOC_MAX_NELEMS(type) (((1U<<(sizeof(int)*8-1))-1)/sizeof(type))
154
155unsigned long OpenSSL_version_num(void);
156const char *OpenSSL_version(int type);
157# define OPENSSL_VERSION 0
158# define OPENSSL_CFLAGS 1
159# define OPENSSL_BUILT_ON 2
160# define OPENSSL_PLATFORM 3
161# define OPENSSL_DIR 4
162# define OPENSSL_ENGINES_DIR 5
163
165
166typedef void CRYPTO_EX_new (void *parent, void *ptr, CRYPTO_EX_DATA *ad,
167 int idx, long argl, void *argp);
168typedef void CRYPTO_EX_free (void *parent, void *ptr, CRYPTO_EX_DATA *ad,
169 int idx, long argl, void *argp);
170typedef int CRYPTO_EX_dup (CRYPTO_EX_DATA *to, const CRYPTO_EX_DATA *from,
171 void *from_d, int idx, long argl, void *argp);
172__owur int CRYPTO_get_ex_new_index(int class_index, long argl, void *argp,
173 CRYPTO_EX_new *new_func, CRYPTO_EX_dup *dup_func,
174 CRYPTO_EX_free *free_func);
175/* No longer use an index. */
176int CRYPTO_free_ex_index(int class_index, int idx);
177
178/*
179 * Initialise/duplicate/free CRYPTO_EX_DATA variables corresponding to a
180 * given class (invokes whatever per-class callbacks are applicable)
181 */
182int CRYPTO_new_ex_data(int class_index, void *obj, CRYPTO_EX_DATA *ad);
183int CRYPTO_dup_ex_data(int class_index, CRYPTO_EX_DATA *to,
184 const CRYPTO_EX_DATA *from);
185
186void CRYPTO_free_ex_data(int class_index, void *obj, CRYPTO_EX_DATA *ad);
187
188/*
189 * Get/set data in a CRYPTO_EX_DATA variable corresponding to a particular
190 * index (relative to the class type involved)
191 */
192int CRYPTO_set_ex_data(CRYPTO_EX_DATA *ad, int idx, void *val);
193void *CRYPTO_get_ex_data(const CRYPTO_EX_DATA *ad, int idx);
194
195# if OPENSSL_API_COMPAT < 0x10100000L
196/*
197 * This function cleans up all "ex_data" state. It mustn't be called under
198 * potential race-conditions.
199 */
200# define CRYPTO_cleanup_all_ex_data() while(0) continue
201
202/*
203 * The old locking functions have been removed completely without compatibility
204 * macros. This is because the old functions either could not properly report
205 * errors, or the returned error values were not clearly documented.
206 * Replacing the locking functions with no-ops would cause race condition
207 * issues in the affected applications. It is far better for them to fail at
208 * compile time.
209 * On the other hand, the locking callbacks are no longer used. Consequently,
210 * the callback management functions can be safely replaced with no-op macros.
211 */
212# define CRYPTO_num_locks() (1)
213# define CRYPTO_set_locking_callback(func)
214# define CRYPTO_get_locking_callback() (NULL)
215# define CRYPTO_set_add_lock_callback(func)
216# define CRYPTO_get_add_lock_callback() (NULL)
217
218/*
219 * These defines where used in combination with the old locking callbacks,
220 * they are not called anymore, but old code that's not called might still
221 * use them.
222 */
223# define CRYPTO_LOCK 1
224# define CRYPTO_UNLOCK 2
225# define CRYPTO_READ 4
226# define CRYPTO_WRITE 8
227
228/* This structure is no longer used */
229typedef struct crypto_threadid_st {
230 int dummy;
231} CRYPTO_THREADID;
232/* Only use CRYPTO_THREADID_set_[numeric|pointer]() within callbacks */
233# define CRYPTO_THREADID_set_numeric(id, val)
234# define CRYPTO_THREADID_set_pointer(id, ptr)
235# define CRYPTO_THREADID_set_callback(threadid_func) (0)
236# define CRYPTO_THREADID_get_callback() (NULL)
237# define CRYPTO_THREADID_current(id)
238# define CRYPTO_THREADID_cmp(a, b) (-1)
239# define CRYPTO_THREADID_cpy(dest, src)
240# define CRYPTO_THREADID_hash(id) (0UL)
241
242# if OPENSSL_API_COMPAT < 0x10000000L
243# define CRYPTO_set_id_callback(func)
244# define CRYPTO_get_id_callback() (NULL)
245# define CRYPTO_thread_id() (0UL)
246# endif /* OPENSSL_API_COMPAT < 0x10000000L */
247
248# define CRYPTO_set_dynlock_create_callback(dyn_create_function)
249# define CRYPTO_set_dynlock_lock_callback(dyn_lock_function)
250# define CRYPTO_set_dynlock_destroy_callback(dyn_destroy_function)
251# define CRYPTO_get_dynlock_create_callback() (NULL)
252# define CRYPTO_get_dynlock_lock_callback() (NULL)
253# define CRYPTO_get_dynlock_destroy_callback() (NULL)
254# endif /* OPENSSL_API_COMPAT < 0x10100000L */
255
257 void *(*m) (size_t, const char *, int),
258 void *(*r) (void *, size_t, const char *, int),
259 void (*f) (void *, const char *, int));
262 void *(**m) (size_t, const char *, int),
263 void *(**r) (void *, size_t, const char *, int),
264 void (**f) (void *, const char *, int));
265
266void *CRYPTO_malloc(size_t num, const char *file, int line);
267void *CRYPTO_zalloc(size_t num, const char *file, int line);
268void *CRYPTO_memdup(const void *str, size_t siz, const char *file, int line);
269char *CRYPTO_strdup(const char *str, const char *file, int line);
270char *CRYPTO_strndup(const char *str, size_t s, const char *file, int line);
271void CRYPTO_free(void *ptr, const char *file, int line);
272void CRYPTO_clear_free(void *ptr, size_t num, const char *file, int line);
273void *CRYPTO_realloc(void *addr, size_t num, const char *file, int line);
274void *CRYPTO_clear_realloc(void *addr, size_t old_num, size_t num,
275 const char *file, int line);
276
277int CRYPTO_secure_malloc_init(size_t sz, int minsize);
279void *CRYPTO_secure_malloc(size_t num, const char *file, int line);
280void *CRYPTO_secure_zalloc(size_t num, const char *file, int line);
281void CRYPTO_secure_free(void *ptr, const char *file, int line);
282void CRYPTO_secure_clear_free(void *ptr, size_t num,
283 const char *file, int line);
284int CRYPTO_secure_allocated(const void *ptr);
288
289void OPENSSL_cleanse(void *ptr, size_t len);
290
292# define OPENSSL_mem_debug_push(info)
293 CRYPTO_mem_debug_push(info, OPENSSL_FILE, OPENSSL_LINE)
294# define OPENSSL_mem_debug_pop()
295 CRYPTO_mem_debug_pop()
296int CRYPTO_mem_debug_push(const char *info, const char *file, int line);
297int CRYPTO_mem_debug_pop(void);
298void CRYPTO_get_alloc_counts(int *mcount, int *rcount, int *fcount);
299
300/*-
301 * Debugging functions (enabled by CRYPTO_set_mem_debug(1))
302 * The flag argument has the following significance:
303 * 0: called before the actual memory allocation has taken place
304 * 1: called after the actual memory allocation has taken place
305 */
306void CRYPTO_mem_debug_malloc(void *addr, size_t num, int flag,
307 const char *file, int line);
308void CRYPTO_mem_debug_realloc(void *addr1, void *addr2, size_t num, int flag,
309 const char *file, int line);
310void CRYPTO_mem_debug_free(void *addr, int flag,
311 const char *file, int line);
312
313int CRYPTO_mem_leaks_cb(int (*cb) (const char *str, size_t len, void *u),
314 void *u);
315# ifndef OPENSSL_NO_STDIO
316int CRYPTO_mem_leaks_fp(FILE *);
317# endif
318int CRYPTO_mem_leaks(BIO *bio);
319# endif
320
321/* die if we have to */
322ossl_noreturn void OPENSSL_die(const char *assertion, const char *file, int line);
323# if OPENSSL_API_COMPAT < 0x10100000L
324# define OpenSSLDie(f,l,a) OPENSSL_die((a),(f),(l))
325# endif
326# define OPENSSL_assert(e)
327 (void)((e) ? 0 : (OPENSSL_die("assertion failed: " #e, OPENSSL_FILE, OPENSSL_LINE), 1))
328
330
331int FIPS_mode(void);
332int FIPS_mode_set(int r);
333
334void OPENSSL_init(void);
335# ifdef OPENSSL_SYS_UNIX
336void OPENSSL_fork_prepare(void);
337void OPENSSL_fork_parent(void);
338void OPENSSL_fork_child(void);
339# endif
340
341struct tm *OPENSSL_gmtime(const time_t *timer, struct tm *result);
342int OPENSSL_gmtime_adj(struct tm *tm, int offset_day, long offset_sec);
343int OPENSSL_gmtime_diff(int *pday, int *psec,
344 const struct tm *from, const struct tm *to);
345
346/*
347 * CRYPTO_memcmp returns zero iff the |len| bytes at |a| and |b| are equal.
348 * It takes an amount of time dependent on |len|, but independent of the
349 * contents of |a| and |b|. Unlike memcmp, it cannot be used to put elements
350 * into a defined order as the return value when a != b is undefined, other
351 * than to be non-zero.
352 */
353int CRYPTO_memcmp(const void * in_a, const void * in_b, size_t len);
354
355/* Standard initialisation options */
356# define OPENSSL_INIT_NO_LOAD_CRYPTO_STRINGS 0x00000001L
357# define OPENSSL_INIT_LOAD_CRYPTO_STRINGS 0x00000002L
358# define OPENSSL_INIT_ADD_ALL_CIPHERS 0x00000004L
359# define OPENSSL_INIT_ADD_ALL_DIGESTS 0x00000008L
360# define OPENSSL_INIT_NO_ADD_ALL_CIPHERS 0x00000010L
361# define OPENSSL_INIT_NO_ADD_ALL_DIGESTS 0x00000020L
362# define OPENSSL_INIT_LOAD_CONFIG 0x00000040L
363# define OPENSSL_INIT_NO_LOAD_CONFIG 0x00000080L
364# define OPENSSL_INIT_ASYNC 0x00000100L
365# define OPENSSL_INIT_ENGINE_RDRAND 0x00000200L
366# define OPENSSL_INIT_ENGINE_DYNAMIC 0x00000400L
367# define OPENSSL_INIT_ENGINE_OPENSSL 0x00000800L
368# define OPENSSL_INIT_ENGINE_CRYPTODEV 0x00001000L
369# define OPENSSL_INIT_ENGINE_CAPI 0x00002000L
370# define OPENSSL_INIT_ENGINE_PADLOCK 0x00004000L
371# define OPENSSL_INIT_ENGINE_AFALG 0x00008000L
372/* OPENSSL_INIT_ZLIB 0x00010000L */
373# define OPENSSL_INIT_ATFORK 0x00020000L
374/* OPENSSL_INIT_BASE_ONLY 0x00040000L */
375# define OPENSSL_INIT_NO_ATEXIT 0x00080000L
376/* OPENSSL_INIT flag range 0xfff00000 reserved for OPENSSL_init_ssl() */
377/* Max OPENSSL_INIT flag value is 0x80000000 */
378
379/* openssl and dasync not counted as builtin */
380# define OPENSSL_INIT_ENGINE_ALL_BUILTIN
384
385
386/* Library initialisation functions */
388int OPENSSL_init_crypto(uint64_t opts, const OPENSSL_INIT_SETTINGS *settings);
389int OPENSSL_atexit(void (*handler)(void));
391
392/* Low-level control of initialization */
394# ifndef OPENSSL_NO_STDIO
396 const char *config_filename);
398 unsigned long flags);
400 const char *config_appname);
401# endif
403
404# if defined(OPENSSL_THREADS) && !defined(CRYPTO_TDEBUG)
405# if defined(_WIN32)
406# if defined(BASETYPES) || defined(_WINDEF_H)
407/* application has to include <windows.h> in order to use this */
408typedef DWORD CRYPTO_THREAD_LOCAL;
409typedef DWORD CRYPTO_THREAD_ID;
410
411typedef LONG CRYPTO_ONCE;
412# define CRYPTO_ONCE_STATIC_INIT 0
413# endif
414# else
415# include <pthread.h>
416typedef pthread_once_t CRYPTO_ONCE;
417typedef pthread_key_t CRYPTO_THREAD_LOCAL;
418typedef pthread_t CRYPTO_THREAD_ID;
419
420# define CRYPTO_ONCE_STATIC_INIT PTHREAD_ONCE_INIT
421# endif
422# endif
423
424# if !defined(CRYPTO_ONCE_STATIC_INIT)
425typedef unsigned int CRYPTO_ONCE;
426typedef unsigned int CRYPTO_THREAD_LOCAL;
427typedef unsigned int CRYPTO_THREAD_ID;
428# define CRYPTO_ONCE_STATIC_INIT 0
429# endif
430
431int CRYPTO_THREAD_run_once(CRYPTO_ONCE *once, void (*init)(void));
432
433int CRYPTO_THREAD_init_local(CRYPTO_THREAD_LOCAL *key, void (*cleanup)(void *));
434void *CRYPTO_THREAD_get_local(CRYPTO_THREAD_LOCAL *key);
435int CRYPTO_THREAD_set_local(CRYPTO_THREAD_LOCAL *key, void *val);
436int CRYPTO_THREAD_cleanup_local(CRYPTO_THREAD_LOCAL *key);
437
438CRYPTO_THREAD_ID CRYPTO_THREAD_get_current_id(void);
439int CRYPTO_THREAD_compare_id(CRYPTO_THREAD_ID a, CRYPTO_THREAD_ID b);
440
441
442# ifdef __cplusplus
443}
444# endif
445#endif
#define ARK_API
Definition Base.h:9
#define poco_unexpected()
Definition Bugcheck.h:140
#define POCO_EXTERNAL_OPENSSL
Definition Config.h:189
#define POCO_NO_SOO
Definition Config.h:82
#define POCO_DECLARE_EXCEPTION(API, CLS, BASE)
Definition Exception.h:157
#define POCO_DECLARE_EXCEPTION_CODE(API, CLS, BASE, CODE)
Definition Exception.h:140
#define POCO_DO_JOIN2(X, Y)
Definition Foundation.h:134
#define POCO_DO_JOIN(X, Y)
Definition Foundation.h:133
#define Foundation_API
Definition Foundation.h:60
#define POCO_JOIN(X, Y)
Definition Foundation.h:132
#define POCO_HAVE_IPv6
Definition Net.h:64
#define Net_API
Definition Net.h:47
#define NetSSL_API
Definition NetSSL.h:48
#define POCO_OS_IRIX
Definition Platform.h:35
#define POCO_OS_TRU64
Definition Platform.h:30
#define POCO_OS_WINDOWS_NT
Definition Platform.h:43
#define POCO_OS_HPUX
Definition Platform.h:29
#define POCO_OS_CYGWIN
Definition Platform.h:39
#define POCO_OS_WINDOWS_CE
Definition Platform.h:44
#define POCO_UNUSED
Definition Platform.h:274
#define POCO_OS_VXWORKS
Definition Platform.h:38
#define POCO_OS_ANDROID
Definition Platform.h:41
#define POCO_OS_QNX
Definition Platform.h:37
#define POCO_OS_AIX
Definition Platform.h:28
#define POCO_OS_LINUX
Definition Platform.h:31
#define POCO_OS_SOLARIS
Definition Platform.h:36
#define POCO_ARCH_AMD64
Definition Platform.h:129
#define OPENSSL_VERSION_PREREQ(maj, min)
Definition Crypto.h:36
#define Crypto_API
Definition Crypto.h:82
RSAPaddingMode
The padding mode used for RSA public key encryption.
Definition Crypto.h:44
@ RSA_PADDING_PKCS1_OAEP
PKCS #1 v1.5 padding. This currently is the most widely used mode.
Definition Crypto.h:48
@ RSA_PADDING_NONE
Definition Crypto.h:52
@ RSA_PADDING_PKCS1
Definition Crypto.h:45
#define POCO_EXTERNAL_OPENSSL_SLPRO
Definition Crypto.h:24
#define poco_ntoh_32(x)
Definition SocketDefs.h:328
#define INADDR_NONE
Definition SocketDefs.h:291
#define INADDR_BROADCAST
Definition SocketDefs.h:299
#define INADDR_ANY
Definition SocketDefs.h:295
#define poco_ntoh_16(x)
Definition SocketDefs.h:326
#define INADDR_LOOPBACK
Definition SocketDefs.h:303
virtual std::unique_ptr< ArkApi::ICommands > & GetCommands()=0
std::mutex RequestMutex_
Definition Requests.cpp:47
void WriteRequest(std::function< void(bool, std::string)> callback, bool success, std::string result)
Definition Requests.cpp:73
std::string GetResponse(Poco::Net::HTTPClientSession *session, Poco::Net::HTTPResponse &response)
Definition Requests.cpp:107
Poco::Net::HTTPRequest ConstructRequest(const std::string &url, Poco::Net::HTTPClientSession *&session, const std::vector< std::string > &headers, const std::string &request_type)
Definition Requests.cpp:79
std::vector< RequestData > RequestsVec_
Definition Requests.cpp:46
Requests(Requests &&)=delete
ARK_API bool CreateGetRequest(const std::string &url, const std::function< void(bool, std::string)> &callback, std::vector< std::string > headers={})
Creates an async GET Request that runs in another thread but calls the callback from the main thread.
Definition Requests.cpp:129
ARK_API bool CreatePostRequest(const std::string &url, const std::function< void(bool, std::string)> &callback, const std::vector< std::string > &post_ids, const std::vector< std::string > &post_data, std::vector< std::string > headers={})
Creates an async POST Request that runs in another thread but calls the callback from the main thread...
Definition Requests.cpp:238
Requests & operator=(Requests &&)=delete
ARK_API bool CreateDeleteRequest(const std::string &url, const std::function< void(bool, std::string)> &callback, std::vector< std::string > headers={})
Creates an async DELETE Request that runs in another thread but calls the callback from the main thre...
Definition Requests.cpp:292
Requests & operator=(const Requests &)=delete
ARK_API bool CreatePostRequest(const std::string &url, const std::function< void(bool, std::string)> &callback, const std::string &post_data, std::vector< std::string > headers={})
Creates an async POST Request with application/x-www-form-urlencoded content type that runs in anothe...
Definition Requests.cpp:162
static ARK_API Requests & Get()
Definition Requests.cpp:67
ARK_API bool CreatePostRequest(const std::string &url, const std::function< void(bool, std::string)> &callback, const std::string &post_data, const std::string &content_type, std::vector< std::string > headers={})
Creates an async POST Request that runs in another thread but calls the callback from the main thread...
Definition Requests.cpp:200
std::unique_ptr< impl > pimpl
Definition Requests.h:84
Requests(const Requests &)=delete
virtual void AddOnTickCallback(const FString &id, const std::function< void(float)> &callback)=0
Added function will be called every frame.
virtual bool RemoveOnTickCallback(const FString &id)=0
Removes a on-tick callback.
Definition Logger.h:9
static std::shared_ptr< spdlog::logger > & GetLog()
Definition Logger.h:22
ValueType operator--()
Increments the counter and returns the previous value.
ValueType operator++()
Returns the value of the counter.
ValueType operator++(int)
Increments the counter and returns the result.
AtomicCounter(ValueType initialValue)
Creates a new AtomicCounter and initializes it to zero.
operator ValueType() const
Assigns a value to the counter.
ValueType operator--(int)
Decrements the counter and returns the result.
ValueType value() const
Converts the AtomicCounter to ValueType.
AtomicCounter & operator=(const AtomicCounter &counter)
Destroys the AtomicCounter.
AtomicCounter & operator=(ValueType value)
Assigns the value of another AtomicCounter.
AtomicCounter()
The underlying integer type.
bool operator!() const
Decrements the counter and returns the previous value.
AtomicCounter(const AtomicCounter &counter)
~AtomicCounter()
Creates the counter by copying another one.
std::atomic< int > _counter
Returns true if the counter is zero, false otherwise.
static std::string what(const char *msg, const char *file, int line, const char *text=0)
static void bugcheck(const char *msg, const char *file, int line)
static void nullPointer(const char *ptr, const char *file, int line)
static void debugger(const char *msg, const char *file, int line)
static void debugger(const char *file, int line)
static void bugcheck(const char *file, int line)
static void assertion(const char *cond, const char *file, int line, const char *text=0)
static void unexpected(const char *file, int line)
static struct CRYPTO_dynlock_value * dynlockCreate(const char *file, int line)
static void uninitialize()
Initializes the OpenSSL machinery.
static void initialize()
Automatically shut down OpenSSL on exit.
~OpenSSLInitializer()
Automatically initialize OpenSSL on startup.
static void lock(int mode, int n, const char *file, int line)
static unsigned long id()
static Poco::AtomicCounter _rc
static void enableFIPSMode(bool enabled)
static Poco::FastMutex * _mutexes
static void dynlock(int mode, struct CRYPTO_dynlock_value *lock, const char *file, int line)
static bool isFIPSEnabled()
Shuts down the OpenSSL machinery.
static void dynlockDestroy(struct CRYPTO_dynlock_value *lock, const char *file, int line)
This class represents a X509 Certificate.
void swap(X509Certificate &cert)
Move assignment.
std::string subjectName(NID nid) const
Returns the certificate subject's distinguished name.
bool equals(const X509Certificate &otherCertificate) const
const X509 * certificate() const
Poco::DateTime expiresOn() const
Returns the date and time the certificate is valid from.
X509Certificate(X509 *pCert, bool shared)
std::string issuerName(NID nid) const
Returns the certificate issuer's distinguished name.
const std::string & subjectName() const
X509Certificate(const X509Certificate &cert)
const std::string & serialNumber() const
Returns the version of the certificate.
X509Certificate & operator=(const X509Certificate &cert)
Creates the certificate by moving another one.
X509 * dup() const
Returns the underlying OpenSSL certificate.
~X509Certificate()
Exchanges the certificate with another one.
bool issuedBy(const X509Certificate &issuerCertificate) const
const std::string & issuerName() const
long version() const
Destroys the X509Certificate.
X509Certificate(X509Certificate &&cert) noexcept
Creates the certificate by copying another one.
void load(std::istream &stream)
Writes the list of certificates to the specified PEM file.
std::string signatureAlgorithm() const
void print(std::ostream &out) const
Returns the certificate signature algorithm long name.
Poco::DateTime validFrom() const
X509Certificate(std::istream &istr)
std::string commonName() const
void save(std::ostream &stream) const
OpenSSLInitializer _openSSLInitializer
X509Certificate & operator=(X509Certificate &&cert) noexcept
Assigns a certificate.
Exception(const Exception &exc)
virtual const char * what() const noexcept
Returns the name of the exception class.
const std::string & message() const
Definition Exception.h:116
void message(const std::string &msg)
Standard constructor.
Definition Exception.h:122
Exception(const std::string &msg, const Exception &nested, int code=0)
Creates an exception.
std::string _msg
Sets the extended message for the exception.
Definition Exception.h:101
Exception(const std::string &msg, const std::string &arg, int code=0)
Creates an exception.
const Exception * nested() const
Definition Exception.h:110
Exception * _pNested
Definition Exception.h:102
virtual Exception * clone() const
Exception & operator=(const Exception &exc)
Destroys the exception and deletes the nested exception.
Exception(int code=0)
virtual void rethrow() const
void extendedMessage(const std::string &arg)
Sets the message for the exception.
virtual const char * name() const noexcept
Assignment operator.
int code() const
Returns the message text.
Definition Exception.h:128
~Exception() noexcept
Copy constructor.
std::string displayText() const
Returns the exception code if defined.
Exception(const std::string &msg, int code=0)
virtual const char * className() const noexcept
Returns a static string describing the exception.
void unlock()
Definition Mutex.h:333
bool tryLock(long milliseconds)
Definition Mutex.h:327
~FastMutex()
creates the Mutex.
void lock()
destroys the Mutex.
Definition Mutex.h:308
bool tryLock()
Definition Mutex.h:321
FastMutex(const FastMutex &)
void lock(long milliseconds)
Definition Mutex.h:314
FastMutex & operator=(const FastMutex &)
bool tryLock(long milliseconds)
Definition Mutex.h:292
void lock(long milliseconds)
Definition Mutex.h:279
void unlock()
Definition Mutex.h:298
void lock()
destroys the Mutex.
Definition Mutex.h:273
Mutex & operator=(const Mutex &)
bool tryLock()
Definition Mutex.h:286
Mutex(const Mutex &)
~Mutex()
creates the Mutex.
bool tryLockImpl(long milliseconds)
void init(const Params &params)
void setSessionCacheSize(std::size_t size)
Returns true iff the session cache is enabled.
std::size_t getSessionCacheSize() const
Context::VerificationMode verificationMode() const
Returns true iff the context is for use by a server.
Definition Context.h:466
void requireMinimumProtocol(Protocols protocol)
void enableExtendedCertificateVerification(bool flag=true)
void setInvalidCertificateHandler(InvalidCertificateHandlerPtr pInvalidCertificageHandler)
Usage _usage
Create a SSL_CTX object according to Context configuration.
Definition Context.h:437
Usage usage() const
Returns the underlying OpenSSL SSL Context object.
Definition Context.h:449
SSL_CTX * sslContext() const
Definition Context.h:472
long getSessionTimeout() const
void usePrivateKey(const Poco::Crypto::RSAKey &key)
Add one trusted certification authority to be used by the Context.
void enableSessionCache(bool flag=true)
Returns the verification mode.
void addCertificateAuthority(const Poco::Crypto::X509Certificate &certificate)
Adds a certificate for certificate chain validation.
void usePrivateKey(const Poco::Crypto::EVPPKey &pkey)
bool extendedCertificateVerificationEnabled() const
Definition Context.h:478
bool isForServerUse() const
Definition Context.h:455
void addChainCertificate(const Poco::Crypto::X509Certificate &certificate)
bool _ocspStaplingResponseVerification
Definition Context.h:441
bool ocspStaplingResponseVerificationEnabled() const
Definition Context.h:484
bool _extendedCertificateVerification
Definition Context.h:440
VerificationMode _mode
Definition Context.h:438
@ SERVER_USE
DEPRECATED. Context is used by a client.
Definition Context.h:71
@ TLSV1_2_CLIENT_USE
DEPRECATED. Context is used by a server requiring TLSv1.1 (OpenSSL 1.0.0 or newer).
Definition Context.h:76
@ TLSV1_CLIENT_USE
DEPRECATED. Context is used by a server.
Definition Context.h:72
@ TLSV1_3_SERVER_USE
DEPRECATED. Context is used by a client requiring TLSv1.3 (OpenSSL 1.1.1 or newer).
Definition Context.h:79
@ CLIENT_USE
Context is used by a client for TLSv1 or higher. Use requireMinimumProtocol() or disableProtocols() t...
Definition Context.h:70
@ TLSV1_2_SERVER_USE
DEPRECATED. Context is used by a client requiring TLSv1.2 (OpenSSL 1.0.1 or newer).
Definition Context.h:77
@ TLSV1_SERVER_USE
DEPRECATED. Context is used by a client requiring TLSv1.
Definition Context.h:73
@ TLSV1_3_CLIENT_USE
DEPRECATED. Context is used by a server requiring TLSv1.2 (OpenSSL 1.0.1 or newer).
Definition Context.h:78
@ TLS_SERVER_USE
Context is used by a client for TLSv1 or higher. Use requireMinimumProtocol() or disableProtocols() t...
Definition Context.h:69
@ TLSV1_1_CLIENT_USE
DEPRECATED. Context is used by a server requiring TLSv1.
Definition Context.h:74
@ TLSV1_1_SERVER_USE
DEPRECATED. Context is used by a client requiring TLSv1.1 (OpenSSL 1.0.0 or newer).
Definition Context.h:75
void useCertificate(const Poco::Crypto::X509Certificate &certificate)
Destroys the Context.
void preferServerCiphers()
Context(Usage usage, const Params &params)
InvalidCertificateHandlerPtr _pInvalidCertificateHandler
Definition Context.h:442
void setSessionTimeout(long seconds)
InvalidCertificateHandlerPtr getInvalidCertificateHandler() const
Definition Context.h:490
void disableStatelessSessionResumption()
bool sessionCacheEnabled() const
void disableProtocols(int protocols)
SSL_CTX * _pSSLContext
Definition Context.h:439
virtual std::istream & receiveResponse(HTTPResponse &response)
virtual std::ostream & sendRequest(HTTPRequest &request)
Returns the connection timeout for HTTP connections.
static const std::string HTTP_1_1
void setContentLength(std::streamsize length)
Returns the HTTP version for this message.
HTTPRequest(const std::string &method, const std::string &uri, const std::string &version)
Creates a HTTP/1.0 request with the given method and URI.
static const std::string HTTP_GET
static const std::string HTTP_DELETE
static const std::string HTTP_POST
const std::string & getReason() const
Sets the HTTP reason phrase.
HTTPResponse(HTTPStatus status)
HTTPStatus getStatus() const
HTTPSClientSession(const std::string &host, Poco::UInt16 port, Context::Ptr pContext, Session::Ptr pSession)
std::string proxyRequestPrefix() const
Sends the given HTTPRequest over an existing connection.
HTTPSClientSession(Context::Ptr pContext, Session::Ptr pSession)
HTTPSClientSession(Context::Ptr pContext)
Creates a HTTPSClientSession using the given host and port.
void proxyAuthenticate(HTTPRequest &request)
Checks if we can reuse a persistent connection.
int read(char *buffer, std::streamsize length)
HTTPSClientSession(const HTTPSClientSession &)
void connect(const SocketAddress &address)
Refills the internal buffer.
HTTPSClientSession(const SecureStreamSocket &socket, Session::Ptr pSession)
X509Certificate serverCertificate()
HTTPSClientSession & operator=(const HTTPSClientSession &)
HTTPSClientSession(const std::string &host, Poco::UInt16 port=HTTPS_PORT)
HTTPSClientSession(const SecureStreamSocket &socket)
Creates an unconnected HTTPSClientSession.
HTTPSClientSession(const std::string &host, Poco::UInt16 port, Context::Ptr pContext)
InvalidCertificateHandler(bool handleErrorsOnServerSide)
virtual void onInvalidCertificate(const void *pSender, VerificationErrorArgs &errorCert)=0
Destroys the InvalidCertificateHandler.
RejectCertificateHandler(bool handleErrorsOnServerSide)
void initializeClient(PrivateKeyPassphraseHandlerPtr ptrPassphraseHandler, InvalidCertificateHandlerPtr ptrHandler, Context::Ptr ptrContext)
static SSLManager & instance()
static std::string convertCertificateError(long errCode)
static std::string getLastError()
Converts an SSL certificate handling error code into an error message.
static void clearErrorStack()
Returns the last error from the error stack.
A utility class for certificate error handling.
void unlock()
Does nothing.
Definition Mutex.h:258
void lock(long)
Does nothing.
Definition Mutex.h:241
NullMutex()
Creates the NullMutex.
Definition Mutex.h:226
bool tryLock()
Does nothing and always returns true.
Definition Mutex.h:246
void lock()
Does nothing.
Definition Mutex.h:236
~NullMutex()
Destroys the NullMutex.
Definition Mutex.h:231
bool tryLock(long)
Does nothing and always returns true.
Definition Mutex.h:252
This stream discards all characters written to it.
Definition NullStream.h:77
ScopedLock(M &mutex, long milliseconds)
Definition ScopedLock.h:41
ScopedLock(const ScopedLock &)
ScopedLock(M &mutex)
Definition ScopedLock.h:36
ScopedLock & operator=(const ScopedLock &)
ScopedLockWithUnlock & operator=(const ScopedLockWithUnlock &)
ScopedLockWithUnlock(const ScopedLockWithUnlock &)
ScopedLockWithUnlock(M &mutex, long milliseconds)
Definition ScopedLock.h:83
static std::streamsize copyStream(std::istream &istr, std::ostream &ostr, std::size_t bufferSize=8192)
A class that represents time spans up to microsecond resolution.
Definition Timespan.h:30
Timestamp & operator=(const Timestamp &other)
Destroys the timestamp.
Timestamp & operator+=(TimeDiff d)
Definition Timestamp.h:210
Timestamp & operator-=(TimeDiff d)
Definition Timestamp.h:217
Timestamp(TimeVal tv)
Creates a timestamp with the current time.
Timestamp & operator=(TimeVal tv)
bool isElapsed(TimeDiff interval) const
Definition Timestamp.h:249
static const TimeVal TIMEVAL_MIN
Difference between two TimeVal values in microseconds.
Definition Timestamp.h:61
TimeVal epochMicroseconds() const
Definition Timestamp.h:236
static Timestamp fromUtcTime(UtcTimeVal val)
Creates a timestamp from a std::time_t.
TimeDiff elapsed() const
Definition Timestamp.h:242
static TimeDiff resolution()
Definition Timestamp.h:257
bool operator<=(const Timestamp &ts) const
Definition Timestamp.h:186
Timestamp operator+(const Timespan &span) const
std::time_t epochTime() const
Definition Timestamp.h:224
~Timestamp()
Copy constructor.
Timestamp operator-(const Timespan &span) const
bool operator==(const Timestamp &ts) const
Updates the Timestamp with the current time.
Definition Timestamp.h:156
bool operator>=(const Timestamp &ts) const
Definition Timestamp.h:174
Timestamp & operator-=(const Timespan &span)
UtcTimeVal utcTime() const
Definition Timestamp.h:230
Timestamp operator+(TimeDiff d) const
Definition Timestamp.h:192
bool operator<(const Timestamp &ts) const
Definition Timestamp.h:180
static Timestamp fromEpochTime(std::time_t t)
Timestamp()
Maximum timestamp value.
bool operator!=(const Timestamp &ts) const
Definition Timestamp.h:162
static const TimeVal TIMEVAL_MAX
Minimum timestamp value.
Definition Timestamp.h:62
TimeDiff operator-(const Timestamp &ts) const
Definition Timestamp.h:204
Timestamp & operator+=(const Timespan &span)
bool operator>(const Timestamp &ts) const
Definition Timestamp.h:168
Timestamp(const Timestamp &other)
void swap(Timestamp &timestamp)
Timestamp operator-(TimeDiff d) const
Definition Timestamp.h:198
TimeVal raw() const
Definition Timestamp.h:269
void update()
Swaps the Timestamp with another one.
const std::string & getHost() const
Sets the user-info part of the URI.
Definition URI.h:385
const std::string & getScheme() const
Definition URI.h:373
URI(const std::string &uri)
Creates an empty URI.
unsigned short getPort() const
Sets the host part of the URI.
std::string getPathAndQuery() const
Returns the encoded path, query and fragment parts of the URI.
void error(const T &)
#define __owur
Definition e_os2.h:227
#define ossl_noreturn
Definition e_os2.h:287
Definition IBaseApi.h:9
std::unique_ptr< IBaseApi > game_api
Definition IBaseApi.h:25
void Crypto_API uninitializeCrypto()
void Crypto_API initializeCrypto()
std::vector< SocketBuf > SocketBufVec
Definition SocketDefs.h:365
void NetSSL_API initializeSSL()
void Net_API uninitializeNetwork()
void Net_API initializeNetwork()
void NetSSL_API uninitializeSSL()
void swap(Timestamp &s1, Timestamp &s2)
Definition Timestamp.h:263
MutexImpl FastMutexImpl
Definition Mutex_WIN32.h:44
Definition format.h:408
Definition json.hpp:4518
int CRYPTO_secure_malloc_done(void)
int CRYPTO_THREAD_compare_id(CRYPTO_THREAD_ID a, CRYPTO_THREAD_ID b)
void OPENSSL_thread_stop(void)
void CRYPTO_free_ex_data(int class_index, void *obj, CRYPTO_EX_DATA *ad)
int CRYPTO_atomic_add(int *val, int amount, int *ret, CRYPTO_RWLOCK *lock)
void CRYPTO_EX_new(void *parent, void *ptr, CRYPTO_EX_DATA *ad, int idx, long argl, void *argp)
Definition crypto.h:166
size_t OPENSSL_strlcpy(char *dst, const char *src, size_t siz)
int CRYPTO_THREAD_read_lock(CRYPTO_RWLOCK *lock)
void * CRYPTO_get_ex_data(const CRYPTO_EX_DATA *ad, int idx)
int CRYPTO_mem_ctrl(int mode)
void * CRYPTO_clear_realloc(void *addr, size_t old_num, size_t num, const char *file, int line)
void OPENSSL_INIT_set_config_file_flags(OPENSSL_INIT_SETTINGS *settings, unsigned long flags)
int CRYPTO_set_mem_functions(void *(*m)(size_t, const char *, int), void *(*r)(void *, size_t, const char *, int), void(*f)(void *, const char *, int))
#define OPENSSL_INIT_ENGINE_PADLOCK
Definition crypto.h:370
int OPENSSL_gmtime_adj(struct tm *tm, int offset_day, long offset_sec)
#define OPENSSL_INIT_ENGINE_RDRAND
Definition crypto.h:365
void OPENSSL_cleanse(void *ptr, size_t len)
int CRYPTO_new_ex_data(int class_index, void *obj, CRYPTO_EX_DATA *ad)
unsigned long OpenSSL_version_num(void)
int OPENSSL_isservice(void)
#define OPENSSL_DIR
Definition crypto.h:161
int CRYPTO_THREAD_init_local(CRYPTO_THREAD_LOCAL *key, void(*cleanup)(void *))
void CRYPTO_free(void *ptr, const char *file, int line)
int OPENSSL_INIT_set_config_filename(OPENSSL_INIT_SETTINGS *settings, const char *config_filename)
size_t OPENSSL_strnlen(const char *str, size_t maxlen)
int CRYPTO_THREAD_write_lock(CRYPTO_RWLOCK *lock)
unsigned char * OPENSSL_hexstr2buf(const char *str, long *len)
int OPENSSL_init_crypto(uint64_t opts, const OPENSSL_INIT_SETTINGS *settings)
int CRYPTO_THREAD_set_local(CRYPTO_THREAD_LOCAL *key, void *val)
void CRYPTO_get_mem_functions(void *(**m)(size_t, const char *, int), void *(**r)(void *, size_t, const char *, int), void(**f)(void *, const char *, int))
#define OPENSSL_BUILT_ON
Definition crypto.h:159
int OPENSSL_atexit(void(*handler)(void))
#define OPENSSL_CFLAGS
Definition crypto.h:158
void * CRYPTO_malloc(size_t num, const char *file, int line)
int CRYPTO_THREAD_cleanup_local(CRYPTO_THREAD_LOCAL *key)
int CRYPTO_secure_allocated(const void *ptr)
#define OPENSSL_VERSION
Definition crypto.h:157
int CRYPTO_secure_malloc_init(size_t sz, int minsize)
int CRYPTO_THREAD_run_once(CRYPTO_ONCE *once, void(*init)(void))
char * CRYPTO_strdup(const char *str, const char *file, int line)
char * CRYPTO_strndup(const char *str, size_t s, const char *file, int line)
size_t CRYPTO_secure_actual_size(void *ptr)
void * CRYPTO_secure_malloc(size_t num, const char *file, int line)
#define CRYPTO_ONCE_STATIC_INIT
Definition crypto.h:428
int CRYPTO_free_ex_index(int class_index, int idx)
void CRYPTO_clear_free(void *ptr, size_t num, const char *file, int line)
void * CRYPTO_memdup(const void *str, size_t siz, const char *file, int line)
void CRYPTO_EX_free(void *parent, void *ptr, CRYPTO_EX_DATA *ad, int idx, long argl, void *argp)
Definition crypto.h:168
size_t CRYPTO_secure_used(void)
int CRYPTO_EX_dup(CRYPTO_EX_DATA *to, const CRYPTO_EX_DATA *from, void *from_d, int idx, long argl, void *argp)
Definition crypto.h:170
void CRYPTO_RWLOCK
Definition crypto.h:67
int CRYPTO_THREAD_unlock(CRYPTO_RWLOCK *lock)
void * CRYPTO_secure_zalloc(size_t num, const char *file, int line)
int CRYPTO_memcmp(const void *in_a, const void *in_b, size_t len)
int FIPS_mode(void)
void OPENSSL_INIT_free(OPENSSL_INIT_SETTINGS *settings)
CRYPTO_THREAD_ID CRYPTO_THREAD_get_current_id(void)
char * OPENSSL_buf2hexstr(const unsigned char *buffer, long len)
size_t OPENSSL_strlcat(char *dst, const char *src, size_t siz)
#define OPENSSL_INIT_ENGINE_CAPI
Definition crypto.h:369
int CRYPTO_dup_ex_data(int class_index, CRYPTO_EX_DATA *to, const CRYPTO_EX_DATA *from)
__owur int CRYPTO_get_ex_new_index(int class_index, long argl, void *argp, CRYPTO_EX_new *new_func, CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func)
void CRYPTO_THREAD_lock_free(CRYPTO_RWLOCK *lock)
void OPENSSL_cleanup(void)
void * CRYPTO_realloc(void *addr, size_t num, const char *file, int line)
OPENSSL_INIT_SETTINGS * OPENSSL_INIT_new(void)
void OPENSSL_init(void)
void * CRYPTO_THREAD_get_local(CRYPTO_THREAD_LOCAL *key)
int CRYPTO_set_mem_debug(int flag)
int OPENSSL_INIT_set_config_appname(OPENSSL_INIT_SETTINGS *settings, const char *config_appname)
#define OPENSSL_PLATFORM
Definition crypto.h:160
int OPENSSL_hexchar2int(unsigned char c)
int CRYPTO_set_ex_data(CRYPTO_EX_DATA *ad, int idx, void *val)
CRYPTO_RWLOCK * CRYPTO_THREAD_lock_new(void)
int OPENSSL_issetugid(void)
#define OPENSSL_INIT_ENGINE_DYNAMIC
Definition crypto.h:366
void CRYPTO_secure_free(void *ptr, const char *file, int line)
void * CRYPTO_zalloc(size_t num, const char *file, int line)
int CRYPTO_secure_malloc_initialized(void)
ossl_noreturn void OPENSSL_die(const char *assertion, const char *file, int line)
int OPENSSL_gmtime_diff(int *pday, int *psec, const struct tm *from, const struct tm *to)
const char * OpenSSL_version(int type)
#define OPENSSL_INIT_ENGINE_CRYPTODEV
Definition crypto.h:368
struct tm * OPENSSL_gmtime(const time_t *timer, struct tm *result)
void CRYPTO_secure_clear_free(void *ptr, size_t num, const char *file, int line)
int FIPS_mode_set(int r)
#define OPENSSL_API_COMPAT
#define OPENSSL_THREADS
Definition opensslconf.h:37
#define OPENSSL_FILE
#define OPENSSL_NO_CRYPTO_MDEBUG
Definition opensslconf.h:49
#define OPENSSL_LINE
#define OPENSSL_VERSION_NUMBER
Definition opensslv.h:42
struct ssl_ctx_st SSL_CTX
Definition ossl_typ.h:149
struct x509_st X509
Definition ossl_typ.h:121
struct crypto_ex_data_st CRYPTO_EX_DATA
Definition ossl_typ.h:164
struct ossl_init_settings_st OPENSSL_INIT_SETTINGS
Definition ossl_typ.h:142
#define DEFINE_STACK_OF(t)
Definition safestack.h:130
#define STACK_OF(type)
Definition safestack.h:20
#define SSL_VERIFY_NONE
Definition ssl.h:1099
#define SSL_VERIFY_FAIL_IF_NO_PEER_CERT
Definition ssl.h:1101
#define SSL_VERIFY_PEER
Definition ssl.h:1100
#define SSL_VERIFY_CLIENT_ONCE
Definition ssl.h:1102
std::function< void(bool, std::string)> callback
Definition Requests.cpp:41
Family
Possible address families for socket addresses.
Definition SocketDefs.h:373
std::string privateKeyFile
Initializes the struct with default values.
Definition Context.h:134
std::string certificateFile
Definition Context.h:138
VerificationMode verificationMode
Definition Context.h:149
static std::string escape(const std::string &s, bool strictJSON=false)