13#include "tlsdefault.h"
15#include "tlshandler.h"
19#if defined( HAVE_GNUTLS )
21# include "tlsgnutlsclient.h"
22# include "tlsgnutlsclientanon.h"
23# include "tlsgnutlsserveranon.h"
24#elif defined( HAVE_OPENSSL )
26# include "tlsopensslclient.h"
28# include "tlsopensslserver.h"
30#elif defined( HAVE_WINTLS )
32# include "tlsschannel.h"
39 :
TLSBase( th, server ), m_impl( 0 )
46#elif defined( HAVE_OPENSSL )
48#elif defined( HAVE_WINTLS )
80 const std::string& clientCerts,
83 return m_impl ? m_impl->init( clientKey, clientCerts,
94#elif defined( HAVE_OPENSSL )
97#elif defined( HAVE_WINTLS )
105 return m_impl ? m_impl->encrypt( data ) :
false;
110 return m_impl ? m_impl->decrypt( data ) : 0;
121 return m_impl ? m_impl->handshake() :
false;
126 return m_impl ? m_impl->isSecure() :
false;
131 return m_impl ? m_impl->hasChannelBinding() :
false;
136 return m_impl ? m_impl->channelBinding() :
EmptyString;
141 return m_impl ? m_impl->channelBindingType() :
"tls-unique";
147 m_impl->setCACerts( cacerts );
152 return m_impl ? m_impl->fetchTLSInfo() : m_certInfo;
158 m_impl->setClientCert( clientKey, clientCerts );
This class implements an anonymous TLS backend using GnuTLS.
This class implements a TLS backend using GnuTLS.
This class implements (stream) encryption using GnuTLS server-side.
TLSBase(TLSHandler *th, const std::string server)
virtual bool encrypt(const std::string &data)
virtual const CertInfo & fetchTLSInfo() const
virtual void setCACerts(const StringList &cacerts)
virtual void setClientCert(const std::string &clientKey, const std::string &clientCerts)
virtual bool init(const std::string &clientKey=EmptyString, const std::string &clientCerts=EmptyString, const StringList &cacerts=StringList())
virtual const std::string channelBinding() const
virtual bool hasChannelBinding() const
virtual bool isSecure() const
TLSDefault(TLSHandler *th, const std::string server, Type type=VerifyingClient)
virtual int decrypt(const std::string &data)
virtual const std::string channelBindingType() const
An interface that allows for interacting with TLS implementations derived from TLSBase.
The namespace for the gloox library.
std::list< std::string > StringList
const std::string EmptyString