diff --git a/src/vmime/net/session.cpp b/src/vmime/net/session.cpp index 36b9f2c3..cfe58925 100644 --- a/src/vmime/net/session.cpp +++ b/src/vmime/net/session.cpp @@ -39,21 +39,34 @@ namespace net { session::session() - : m_tlsProps(make_shared ()) { + +#if VMIME_HAVE_TLS_SUPPORT + m_tlsProps = make_shared (); +#endif // VMIME_HAVE_TLS_SUPPORT + } session::session(const session& sess) - : object(), m_props(sess.m_props), - m_tlsProps(make_shared (*sess.m_tlsProps)) + : object(), m_props(sess.m_props) { + +#if VMIME_HAVE_TLS_SUPPORT + m_tlsProps = make_shared (*sess.m_tlsProps); +#endif // VMIME_HAVE_TLS_SUPPORT + } session::session(const propertySet& props) - : m_props(props), m_tlsProps(make_shared ()) + : m_props(props) { + +#if VMIME_HAVE_TLS_SUPPORT + m_tlsProps = make_shared (); +#endif // VMIME_HAVE_TLS_SUPPORT + } @@ -138,6 +151,8 @@ propertySet& session::getProperties() } +#if VMIME_HAVE_TLS_SUPPORT + void session::setTLSProperties(shared_ptr tlsProps) { m_tlsProps = make_shared (*tlsProps); @@ -149,6 +164,8 @@ shared_ptr session::getTLSProperties() const return m_tlsProps; } +#endif // VMIME_HAVE_TLS_SUPPORT + } // net } // vmime diff --git a/src/vmime/net/session.hpp b/src/vmime/net/session.hpp index a7e0ea1a..1145ae12 100644 --- a/src/vmime/net/session.hpp +++ b/src/vmime/net/session.hpp @@ -33,7 +33,9 @@ #include "vmime/security/authenticator.hpp" -#include "vmime/net/tls/TLSProperties.hpp" +#if VMIME_HAVE_TLS_SUPPORT +# include "vmime/net/tls/TLSProperties.hpp" +#endif // VMIME_HAVE_TLS_SUPPORT #include "vmime/utility/url.hpp" @@ -149,6 +151,8 @@ public: */ propertySet& getProperties(); +#if VMIME_HAVE_TLS_SUPPORT + /** Set properties for SSL/TLS secured connections in this session. * * @param tlsProps SSL/TLS properties @@ -161,11 +165,16 @@ public: */ shared_ptr getTLSProperties() const; +#endif // VMIME_HAVE_TLS_SUPPORT + private: propertySet m_props; +#if VMIME_HAVE_TLS_SUPPORT shared_ptr m_tlsProps; +#endif // VMIME_HAVE_TLS_SUPPORT + };