2 * @file SSL_CertificateCallback.h
4 * @author Martin Corino <mcorino@remedy.nl>
7 #ifndef ACE_SSL_CERTIFICATECALLBACK_H
8 #define ACE_SSL_CERTIFICATECALLBACK_H
10 #include /**/ "ace/pre.h"
12 #include "ace/SString.h"
13 #include "ace/SSL/SSL_Context.h"
14 #include "ace/INet/SSL_X509Cert.h"
15 #include "ace/INet/INet_SSL_Export.h"
17 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
24 * @class ACE_INet_SSL_CertificateCallbackArg
26 * @brief Encapsulates the arguments for an SSL certificate
27 * verification callback.
30 class ACE_INET_SSL_Export SSL_CertificateCallbackArg
33 SSL_CertificateCallbackArg (const ACE_SSL_Context
* ssl_ctx
,
34 ::X509_STORE_CTX
* cert_ctx
);
35 ~SSL_CertificateCallbackArg ();
37 const ACE_SSL_Context
& context () const;
39 SSL_X509Cert
& certificate ();
41 int error_depth () const;
43 int error_code () const;
45 ACE_CString
error_message () const;
47 bool ignore_error () const;
49 void ignore_error (bool f
);
52 const ACE_SSL_Context
* ssl_ctx_
;
53 SSL_X509Cert ssl_cert_
;
60 * @class ACE_INet_SSL_CertificateCallback
62 * @brief Abstract base class for SSL certificate
63 * verification callbacks.
66 class ACE_INET_SSL_Export SSL_CertificateCallback
69 SSL_CertificateCallback ();
70 virtual ~SSL_CertificateCallback ();
72 virtual void handle_certificate_failure (SSL_CertificateCallbackArg
& arg
) = 0;
76 * @class ACE_INet_SSL_CertificateAcceptor
78 * @brief Implements an SSL certificate callback that accepts
79 * all peer certificates.
82 class ACE_INET_SSL_Export SSL_CertificateAcceptor
83 : public SSL_CertificateCallback
86 SSL_CertificateAcceptor ();
87 virtual ~SSL_CertificateAcceptor ();
89 virtual void handle_certificate_failure (SSL_CertificateCallbackArg
& arg
);
94 ACE_END_VERSIONED_NAMESPACE_DECL
96 #if defined (__ACE_INLINE__)
97 #include "ace/INet/SSL_CertificateCallback.inl"
100 #include /**/ "ace/post.h"
101 #endif /* ACE_SSL_CERTIFICATECALLBACK_H */