1 | // |
2 | // ConsoleCertificateHandler.h |
3 | // |
4 | // Library: NetSSL_OpenSSL |
5 | // Package: SSLCore |
6 | // Module: ConsoleCertificateHandler |
7 | // |
8 | // Definition of the ConsoleCertificateHandler class. |
9 | // |
10 | // Copyright (c) 2006-2009, Applied Informatics Software Engineering GmbH. |
11 | // and Contributors. |
12 | // |
13 | // SPDX-License-Identifier: BSL-1.0 |
14 | // |
15 | |
16 | |
17 | #ifndef NetSSL_ConsoleCertificateHandler_INCLUDED |
18 | #define NetSSL_ConsoleCertificateHandler_INCLUDED |
19 | |
20 | |
21 | #include "Poco/Net/NetSSL.h" |
22 | #include "Poco/Net/InvalidCertificateHandler.h" |
23 | |
24 | |
25 | namespace Poco { |
26 | namespace Net { |
27 | |
28 | |
29 | class NetSSL_API ConsoleCertificateHandler: public InvalidCertificateHandler |
30 | /// A ConsoleCertificateHandler is invoked whenever an error occurs verifying the certificate. |
31 | /// |
32 | /// The certificate is printed to stdout and the user is asked via console if he wants to accept it. |
33 | { |
34 | public: |
35 | ConsoleCertificateHandler(bool handleErrorsOnServerSide); |
36 | /// Creates the ConsoleCertificateHandler. |
37 | |
38 | virtual ~ConsoleCertificateHandler(); |
39 | /// Destroys the ConsoleCertificateHandler. |
40 | |
41 | void onInvalidCertificate(const void* pSender, VerificationErrorArgs& errorCert); |
42 | /// Prints the certificate to stdout and waits for user input on the console |
43 | /// to decide if a certificate should be accepted/rejected. |
44 | }; |
45 | |
46 | |
47 | } } // namespace Poco::Net |
48 | |
49 | |
50 | #endif // NetSSL_ConsoleCertificateHandler_INCLUDED |
51 | |