AcceptCertificateHandler.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. //
  2. // AcceptCertificateHandler.h
  3. //
  4. // Library: NetSSL_OpenSSL
  5. // Package: SSLCore
  6. // Module: AcceptCertificateHandler
  7. //
  8. // Definition of the AcceptCertificateHandler 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_AcceptCertificateHandler_INCLUDED
  16. #define NetSSL_AcceptCertificateHandler_INCLUDED
  17. #include "Poco/Net/NetSSL.h"
  18. #include "Poco/Net/InvalidCertificateHandler.h"
  19. namespace Poco {
  20. namespace Net {
  21. class NetSSL_API AcceptCertificateHandler: public InvalidCertificateHandler
  22. /// A AcceptCertificateHandler is invoked whenever an error
  23. /// occurs verifying the certificate. It always accepts
  24. /// the certificate.
  25. ///
  26. /// Should be using for testing purposes only.
  27. {
  28. public:
  29. AcceptCertificateHandler(bool handleErrorsOnServerSide);
  30. /// Creates the AcceptCertificateHandler
  31. virtual ~AcceptCertificateHandler();
  32. /// Destroys the AcceptCertificateHandler.
  33. void onInvalidCertificate(const void* pSender, VerificationErrorArgs& errorCert);
  34. /// Receives the questionable certificate in parameter errorCert. If one wants to accept the
  35. /// certificate, call errorCert.setIgnoreError(true).
  36. };
  37. } } // namespace Poco::Net
  38. #endif // NetSSL_AcceptCertificateHandler_INCLUDED