Ark Server API (ASE) - Wiki
Loading...
Searching...
No Matches
Exception.h
Go to the documentation of this file.
1//
2// Exception.h
3//
4// Library: Foundation
5// Package: Core
6// Module: Exception
7//
8// Definition of various Poco exception classes.
9//
10// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
11// and Contributors.
12//
13// SPDX-License-Identifier: BSL-1.0
14//
15
16
17#ifndef Foundation_Exception_INCLUDED
18#define Foundation_Exception_INCLUDED
19
20
21#include "Poco/Foundation.h"
22#include <stdexcept>
23
24
25namespace Poco {
26
27
28class Foundation_API Exception: public std::exception
29 /// This is the base class for all exceptions defined
30 /// in the Poco class library.
31{
32public:
33 Exception(const std::string& msg, int code = 0);
34 /// Creates an exception.
35
36 Exception(const std::string& msg, const std::string& arg, int code = 0);
37 /// Creates an exception.
38
39 Exception(const std::string& msg, const Exception& nested, int code = 0);
40 /// Creates an exception and stores a clone
41 /// of the nested exception.
42
43 Exception(const Exception& exc);
44 /// Copy constructor.
45
46 ~Exception() noexcept;
47 /// Destroys the exception and deletes the nested exception.
48
49 Exception& operator = (const Exception& exc);
50 /// Assignment operator.
51
52 virtual const char* name() const noexcept;
53 /// Returns a static string describing the exception.
54
55 virtual const char* className() const noexcept;
56 /// Returns the name of the exception class.
57
58 virtual const char* what() const noexcept;
59 /// Returns a static string describing the exception.
60 ///
61 /// Same as name(), but for compatibility with std::exception.
62
63 const Exception* nested() const;
64 /// Returns a pointer to the nested exception, or
65 /// null if no nested exception exists.
66
67 const std::string& message() const;
68 /// Returns the message text.
69
70 int code() const;
71 /// Returns the exception code if defined.
72
73 std::string displayText() const;
74 /// Returns a string consisting of the
75 /// message name and the message text.
76
77 virtual Exception* clone() const;
78 /// Creates an exact copy of the exception.
79 ///
80 /// The copy can later be thrown again by
81 /// invoking rethrow() on it.
82
83 virtual void rethrow() const;
84 /// (Re)Throws the exception.
85 ///
86 /// This is useful for temporarily storing a
87 /// copy of an exception (see clone()), then
88 /// throwing it again.
89
90protected:
91 Exception(int code = 0);
92 /// Standard constructor.
93
94 void message(const std::string& msg);
95 /// Sets the message for the exception.
96
97 void extendedMessage(const std::string& arg);
98 /// Sets the extended message for the exception.
99
100private:
101 std::string _msg;
103 int _code;
104};
105
106
107//
108// inlines
109//
110inline const Exception* Exception::nested() const
111{
112 return _pNested;
113}
114
115
116inline const std::string& Exception::message() const
117{
118 return _msg;
119}
120
121
122inline void Exception::message(const std::string& msg)
123{
124 _msg = msg;
125}
126
127
128inline int Exception::code() const
129{
130 return _code;
131}
132
133
134//
135// Macros for quickly declaring and implementing exception classes.
136// Unfortunately, we cannot use a template here because character
137// pointers (which we need for specifying the exception name)
138// are not allowed as template arguments.
139//
140#define POCO_DECLARE_EXCEPTION_CODE(API, CLS, BASE, CODE)
141 class API CLS: public BASE
142 {
143 public:
144 CLS(int code = CODE);
145 CLS(const std::string& msg, int code = CODE);
146 CLS(const std::string& msg, const std::string& arg, int code = CODE);
147 CLS(const std::string& msg, const Poco::Exception& exc, int code = CODE);
148 CLS(const CLS& exc);
149 ~CLS() noexcept;
150 CLS& operator = (const CLS& exc);
151 const char* name() const noexcept;
152 const char* className() const noexcept;
153 Poco::Exception* clone() const;
154 void rethrow() const;
155 };
156
157#define POCO_DECLARE_EXCEPTION(API, CLS, BASE)
158 POCO_DECLARE_EXCEPTION_CODE(API, CLS, BASE, 0)
159
160#define POCO_IMPLEMENT_EXCEPTION(CLS, BASE, NAME)
161 CLS::CLS(int code): BASE(code)
162 {
163 }
164 CLS::CLS(const std::string& msg, int code): BASE(msg, code)
165 {
166 }
167 CLS::CLS(const std::string& msg, const std::string& arg, int code): BASE(msg, arg, code)
168 {
169 }
170 CLS::CLS(const std::string& msg, const Poco::Exception& exc, int code): BASE(msg, exc, code)
171 {
172 }
173 CLS::CLS(const CLS& exc): BASE(exc)
174 {
175 }
176 CLS::~CLS() noexcept
177 {
178 }
179 CLS& CLS::operator = (const CLS& exc)
180 {
181 BASE::operator = (exc);
182 return *this;
183 }
184 const char* CLS::name() const noexcept
185 {
186 return NAME;
187 }
188 const char* CLS::className() const noexcept
189 {
190 return typeid(*this).name();
191 }
192 Poco::Exception* CLS::clone() const
193 {
194 return new CLS(*this);
195 }
196 void CLS::rethrow() const
197 {
198 throw *this;
199 }
200
201
202//
203// Standard exception classes
204//
206POCO_DECLARE_EXCEPTION(Foundation_API, AssertionViolationException, LogicException)
207POCO_DECLARE_EXCEPTION(Foundation_API, NullPointerException, LogicException)
208POCO_DECLARE_EXCEPTION(Foundation_API, NullValueException, LogicException)
209POCO_DECLARE_EXCEPTION(Foundation_API, BugcheckException, LogicException)
210POCO_DECLARE_EXCEPTION(Foundation_API, InvalidArgumentException, LogicException)
211POCO_DECLARE_EXCEPTION(Foundation_API, NotImplementedException, LogicException)
212POCO_DECLARE_EXCEPTION(Foundation_API, RangeException, LogicException)
213POCO_DECLARE_EXCEPTION(Foundation_API, IllegalStateException, LogicException)
214POCO_DECLARE_EXCEPTION(Foundation_API, InvalidAccessException, LogicException)
215POCO_DECLARE_EXCEPTION(Foundation_API, SignalException, LogicException)
216POCO_DECLARE_EXCEPTION(Foundation_API, UnhandledException, LogicException)
217
219POCO_DECLARE_EXCEPTION(Foundation_API, NotFoundException, RuntimeException)
220POCO_DECLARE_EXCEPTION(Foundation_API, ExistsException, RuntimeException)
221POCO_DECLARE_EXCEPTION(Foundation_API, TimeoutException, RuntimeException)
222POCO_DECLARE_EXCEPTION(Foundation_API, SystemException, RuntimeException)
223POCO_DECLARE_EXCEPTION(Foundation_API, RegularExpressionException, RuntimeException)
224POCO_DECLARE_EXCEPTION(Foundation_API, LibraryLoadException, RuntimeException)
225POCO_DECLARE_EXCEPTION(Foundation_API, LibraryAlreadyLoadedException, RuntimeException)
226POCO_DECLARE_EXCEPTION(Foundation_API, NoThreadAvailableException, RuntimeException)
227POCO_DECLARE_EXCEPTION(Foundation_API, PropertyNotSupportedException, RuntimeException)
228POCO_DECLARE_EXCEPTION(Foundation_API, PoolOverflowException, RuntimeException)
229POCO_DECLARE_EXCEPTION(Foundation_API, NoPermissionException, RuntimeException)
230POCO_DECLARE_EXCEPTION(Foundation_API, OutOfMemoryException, RuntimeException)
231POCO_DECLARE_EXCEPTION(Foundation_API, DataException, RuntimeException)
232
233POCO_DECLARE_EXCEPTION(Foundation_API, DataFormatException, DataException)
234POCO_DECLARE_EXCEPTION(Foundation_API, SyntaxException, DataException)
235POCO_DECLARE_EXCEPTION(Foundation_API, CircularReferenceException, DataException)
236POCO_DECLARE_EXCEPTION(Foundation_API, PathSyntaxException, SyntaxException)
237POCO_DECLARE_EXCEPTION(Foundation_API, IOException, RuntimeException)
238POCO_DECLARE_EXCEPTION(Foundation_API, ProtocolException, IOException)
239POCO_DECLARE_EXCEPTION(Foundation_API, FileException, IOException)
240POCO_DECLARE_EXCEPTION(Foundation_API, FileExistsException, FileException)
241POCO_DECLARE_EXCEPTION(Foundation_API, FileNotFoundException, FileException)
242POCO_DECLARE_EXCEPTION(Foundation_API, PathNotFoundException, FileException)
243POCO_DECLARE_EXCEPTION(Foundation_API, FileReadOnlyException, FileException)
244POCO_DECLARE_EXCEPTION(Foundation_API, FileAccessDeniedException, FileException)
245POCO_DECLARE_EXCEPTION(Foundation_API, CreateFileException, FileException)
246POCO_DECLARE_EXCEPTION(Foundation_API, OpenFileException, FileException)
247POCO_DECLARE_EXCEPTION(Foundation_API, WriteFileException, FileException)
248POCO_DECLARE_EXCEPTION(Foundation_API, ReadFileException, FileException)
249POCO_DECLARE_EXCEPTION(Foundation_API, DirectoryNotEmptyException, FileException)
250POCO_DECLARE_EXCEPTION(Foundation_API, UnknownURISchemeException, RuntimeException)
251POCO_DECLARE_EXCEPTION(Foundation_API, TooManyURIRedirectsException, RuntimeException)
252POCO_DECLARE_EXCEPTION(Foundation_API, URISyntaxException, SyntaxException)
253
254POCO_DECLARE_EXCEPTION(Foundation_API, ApplicationException, Exception)
255POCO_DECLARE_EXCEPTION(Foundation_API, BadCastException, RuntimeException)
256
257
258} // namespace Poco
259
260
261#endif // Foundation_Exception_INCLUDED
#define ARK_API
Definition Base.h:9
#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
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
static std::streamsize copyStream(std::istream &istr, std::ostream &ostr, std::size_t bufferSize=8192)
bool isElapsed(TimeDiff interval) const
Definition Timestamp.h:249
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 &)
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()
MutexImpl FastMutexImpl
Definition Mutex_WIN32.h:44
Definition format.h:408
Definition json.hpp:4518
#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
#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)