ConsoleCertificateHandler.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. #ifndef NetSSL_ConsoleCertificateHandler_INCLUDED
  16. #define NetSSL_ConsoleCertificateHandler_INCLUDED
  17. #include "Poco/Net/NetSSL.h"
  18. #include "Poco/Net/InvalidCertificateHandler.h"
  19. namespace Poco {
  20. namespace Net {
  21. class NetSSL_API ConsoleCertificateHandler: public InvalidCertificateHandler
  22. /// A ConsoleCertificateHandler is invoked whenever an error occurs verifying the certificate.
  23. ///
  24. /// The certificate is printed to stdout and the user is asked via console if he wants to accept it.
  25. {
  26. public:
  27. ConsoleCertificateHandler(bool handleErrorsOnServerSide);
  28. /// Creates the ConsoleCertificateHandler.
  29. virtual ~ConsoleCertificateHandler();
  30. /// Destroys the ConsoleCertificateHandler.
  31. void onInvalidCertificate(const void* pSender, VerificationErrorArgs& errorCert);
  32. /// Prints the certificate to stdout and waits for user input on the console
  33. /// to decide if a certificate should be accepted/rejected.
  34. };
  35. } } // namespace Poco::Net
  36. #endif // NetSSL_ConsoleCertificateHandler_INCLUDED