<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Class Poco::Net::InvalidCertificateHandler</title> <meta http-equiv="content-type" content="text/html; charset=utf-8"/> <meta name="author" content="Applied Informatics Software Engineering GmbH and Contributors"/> <meta name="publisher" content="Applied Informatics Software Engineering GmbH and Contributors"/> <meta name="copyright" content="Copyright (c) 2009, Applied Informatics Software Engineering GmbH and Contributors"/> <meta name="language" content="en"/> <meta name="date" content="2009-11-24"/> <meta name="generator" content="PocoDoc"/> <link rel="stylesheet" href="css/styles.css" type="text/css"/> </head> <body bgcolor="#ffffff" leftmargin="0" topmargin="0"> <div class="header"> <h1 class="namespace"><a href="Poco.Net.html" class="namespace">Poco::Net</a></h1> <h1 class="symbol">class InvalidCertificateHandler</h1> </div> <div class="body"> <p> <b>Library:</b> NetSSL_OpenSSL<br /> <b>Package:</b> SSLCore<br /> <b>Header:</b> Poco/Net/InvalidCertificateHandler.h</p> <h2>Description</h2> <div class="description"> <p>A <a href="Poco.Net.InvalidCertificateHandler.html" title="class Poco::Net::InvalidCertificateHandler">InvalidCertificateHandler</a> is invoked whenever an error occurs verifying the certificate. It allows the user to inspect and accept/reject the certificate. One can install one's own <a href="Poco.Net.InvalidCertificateHandler.html" title="class Poco::Net::InvalidCertificateHandler">InvalidCertificateHandler</a> by implementing this interface. Note that in the implementation file of the subclass the following code must be present (assuming you use the namespace My_API and the name of your handler class is MyGuiHandler): </p> <p></p> <pre>#include "Poco/Net/CertificateHandlerFactory.h" ... POCO_REGISTER_CHFACTORY(My_API, MyGuiHandler) </pre> <p>One can either set the handler directly in the startup code of the main method of ones application by calling </p> <p></p> <pre>SSLManager::instance().initialize(mypassphraseHandler, myguiHandler, mySSLContext) </pre> <p>or in case one uses <a href="Poco.Util.Application.html" title="class Poco::Util::Application">Poco::Util::Application</a> one can rely on an <a href="Poco.XML.html" title="namespace Poco::XML">XML</a> configuration and put the following entry under the path openSSL.invalidCertificateHandler: </p> <p></p> <pre><invalidCertificateHandler> <name>MyGuiHandler<name> <options> [...] // Put optional config params for the handler here </options> </invalidCertificateHandler> </pre> <p>Note that the name of the <a href="Poco.Net.InvalidCertificateHandler.html" title="class Poco::Net::InvalidCertificateHandler">InvalidCertificateHandler</a> must be same as the one provided to the POCO_REGISTER_CHFACTORY macro. </p> </div> <h2>Inheritance</h2> <p><b>Known Derived Classes: </b><a href="Poco.Net.AcceptCertificateHandler.html" title="class Poco::Net::AcceptCertificateHandler">AcceptCertificateHandler</a>, <a href="Poco.Net.ConsoleCertificateHandler.html" title="class Poco::Net::ConsoleCertificateHandler">ConsoleCertificateHandler</a></p> <h2>Member Summary</h2> <p><b>Member Functions: </b><a href="Poco.Net.InvalidCertificateHandler.html#15788" title="Poco::Net::InvalidCertificateHandler::onInvalidCertificate()">onInvalidCertificate</a></p> <h2>Constructors</h2> <h3><a name="15785">InvalidCertificateHandler</a></h3> <p class="decl"><a href="Poco.Net.InvalidCertificateHandler.html" title="class Poco::Net::InvalidCertificateHandler">InvalidCertificateHandler</a>(<br /> bool handleErrorsOnServerSide<br />);</p> <div class="description"> <p>Creates the <a href="Poco.Net.InvalidCertificateHandler.html" title="class Poco::Net::InvalidCertificateHandler">InvalidCertificateHandler</a>. </p> <p>Set handleErrorsOnServerSide to true if the certificate handler is used on the server side. Automatically registers at one of the SSLManager::VerificationError events. </p> </div> <h2>Destructor</h2> <h3><a name="15787">~InvalidCertificateHandler</a> <img src="images/virtual.gif" alt="virtual" title="virtual" style="vertical-align:baseline;" border="0" /> </h3> <p class="decl">virtual ~<a href="Poco.Net.InvalidCertificateHandler.html" title="class Poco::Net::InvalidCertificateHandler">InvalidCertificateHandler</a>();</p> <div class="description"> <p>Destroys the <a href="Poco.Net.InvalidCertificateHandler.html" title="class Poco::Net::InvalidCertificateHandler">InvalidCertificateHandler</a>. </p> </div> <h2>Member Functions</h2> <h3><a name="15788">onInvalidCertificate</a> <img src="images/virtual.gif" alt="virtual" title="virtual" style="vertical-align:baseline;" border="0" /> </h3> <p class="decl">virtual void onInvalidCertificate(<br /> const void * pSender,<br /> <a href="Poco.Net.VerificationErrorArgs.html" title="class Poco::Net::VerificationErrorArgs">VerificationErrorArgs</a> & errorCert<br />) = 0;</p> <div class="description"> <p>Receives the questionable certificate in parameter errorCert. If one wants to accept the certificate, call errorCert.setIgnoreError(true). </p> </div> <h2>Variables</h2> <h3><a name="15791">_handleErrorsOnServerSide</a> <img src="images/protected.gif" alt="protected" title="protected" style="vertical-align:baseline;" border="0" /> </h3> <p class="decl">bool _handleErrorsOnServerSide;</p> <div class="description"> <p>Stores if the certificate handler gets invoked by the server (i.e. a client certificate is wrong) or the client (a server certificate is wrong) </p> </div> <p class="footer">POCO C++ Libraries 1.3.6-all<br /> Copyright © 2009, <a href="http://pocoproject.org/" target="_blank">Applied Informatics Software Engineering GmbH and Contributors</a></p> </div> </body> </html>