aboutsummaryrefslogtreecommitdiffstats
path: root/camel/providers
diff options
context:
space:
mode:
Diffstat (limited to 'camel/providers')
-rw-r--r--camel/providers/smtp/Makefile.am1
-rw-r--r--camel/providers/smtp/camel-smtp-transport.c12
2 files changed, 11 insertions, 2 deletions
diff --git a/camel/providers/smtp/Makefile.am b/camel/providers/smtp/Makefile.am
index 74597f57f5..fcc2b06f9d 100644
--- a/camel/providers/smtp/Makefile.am
+++ b/camel/providers/smtp/Makefile.am
@@ -19,6 +19,7 @@ INCLUDES = \
$(GTK_INCLUDEDIR) \
$(NSPR_CFLAGS) \
$(NSS_CFLAGS) \
+ $(OPENSSL_CFLAGS) \
-DG_LOG_DOMAIN=\"camel-smtp-provider\"
libcamelsmtp_la_SOURCES = \
diff --git a/camel/providers/smtp/camel-smtp-transport.c b/camel/providers/smtp/camel-smtp-transport.c
index e6f0b8cafa..2d07a26b85 100644
--- a/camel/providers/smtp/camel-smtp-transport.c
+++ b/camel/providers/smtp/camel-smtp-transport.c
@@ -53,6 +53,9 @@
#include "camel-tcp-stream-ssl.h"
#include <prnetdb.h>
#endif
+#ifdef HAVE_OPENSSL
+#include "camel-tcp-stream-openssl.h"
+#endif
#include "camel-session.h"
#include "camel-exception.h"
#include "camel-sasl.h"
@@ -243,16 +246,21 @@ connect_to_server (CamelService *service, CamelException *ex)
port = service->url->port ? service->url->port : SMTP_PORT;
-#ifdef HAVE_NSS
+#if defined(HAVE_NSS) || defined(HAVE_OPENSSL)
if (transport->use_ssl) {
port = service->url->port ? service->url->port : 465;
+#ifdef HAVE_NSS
+ /* use the preferred implementation - NSS */
tcp_stream = camel_tcp_stream_ssl_new (service, service->url->host);
+#else
+ tcp_stream = camel_tcp_stream_openssl_new (service, service->url->host);
+#endif /* HAVE_NSS */
} else {
tcp_stream = camel_tcp_stream_raw_new ();
}
#else
tcp_stream = camel_tcp_stream_raw_new ();
-#endif /* HAVE_NSS */
+#endif /* HAVE_NSS || HAVE_OPENSSL */
ret = camel_tcp_stream_connect (CAMEL_TCP_STREAM (tcp_stream), h, port);
camel_free_host(h);