Permalink
Browse files

darwinssl: add support for native Mac OS X/iOS SSL

  • Loading branch information...
1 parent 07e3ea7 commit 6d1ea388cbd9de7f2a944a0c64f5feaec1b1904a Nick Zitzmann committed with bagder Jun 26, 2012
Showing with 769 additions and 4 deletions.
  1. +26 −1 configure.ac
  2. +2 −2 lib/Makefile.inc
  3. +661 −0 lib/curl_darwinssl.c
  4. +62 −0 lib/curl_darwinssl.h
  5. +2 −1 lib/setup.h
  6. +2 −0 lib/sslgen.c
  7. +14 −0 lib/urldata.h
View
@@ -1371,6 +1371,29 @@ else
AC_MSG_RESULT(no)
fi
+OPT_DARWINSSL=no
+AC_ARG_WITH(darwinssl,dnl
+AC_HELP_STRING([--with-darwinssl],[enable iOS/Mac OS X native SSL/TLS])
+AC_HELP_STRING([--without-darwinssl], [disable iOS/Mac OS X native SSL/TLS]),
+ OPT_DARWINSSL=$withval)
+
+AC_MSG_CHECKING([whether to enable iOS/Mac OS X native SSL/TLS])
+if test "$curl_ssl_msg" = "$init_ssl_msg"; then
+ if test "x$OPT_DARWINSSL" != "xno" &&
+ test -d "/System/Library/Frameworks/Security.framework"; then
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(USE_DARWINSSL, 1, [to enable iOS/Mac OS X native SSL/TLS support])
+ AC_SUBST(USE_DARWINSSL, [1])
+ curl_ssl_msg="enabled (iOS/Mac OS X-native)"
+ DARWINSSL_ENABLED=1
+ LDFLAGS="$LDFLAGS -framework CoreFoundation -framework Security"
+ else
+ AC_MSG_RESULT(no)
+ fi
+else
+ AC_MSG_RESULT(no)
+fi
+
dnl **********************************************************************
dnl Check for the presence of SSL libraries and headers
dnl **********************************************************************
@@ -2233,7 +2256,7 @@ if test "$curl_ssl_msg" = "$init_ssl_msg"; then
fi
fi
-if test "x$OPENSSL_ENABLED$GNUTLS_ENABLED$NSS_ENABLED$POLARSSL_ENABLED$AXTLS_ENABLED$CYASSL_ENABLED$WINSSL_ENABLED" = "x"; then
+if test "x$OPENSSL_ENABLED$GNUTLS_ENABLED$NSS_ENABLED$POLARSSL_ENABLED$AXTLS_ENABLED$CYASSL_ENABLED$WINSSL_ENABLED$DARWINSSL_ENABLED" = "x"; then
AC_MSG_WARN([SSL disabled, you will not be able to use HTTPS, FTPS, NTLM and more.])
AC_MSG_WARN([Use --with-ssl, --with-gnutls, --with-polarssl, --with-cyassl, --with-nss, --with-axtls or --with-winssl to address this.])
else
@@ -2510,6 +2533,8 @@ AC_HELP_STRING([--disable-versioned-symbols], [Disable versioned symbols in shar
versioned_symbols_flavour="AXTLS_"
elif test "x$WINSSL_ENABLED" == "x1"; then
versioned_symbols_flavour="WINSSL_"
+ elif test "x$DARWINSSL_ENABLED" == "x1"; then
+ versioned_symbols_flavour="DARWINSSL_"
else
versioned_symbols_flavour=""
fi
View
@@ -24,7 +24,7 @@ CSOURCES = file.c timeval.c base64.c hostip.c progress.c formdata.c \
idn_win32.c http_negotiate_sspi.c cyassl.c http_proxy.c non-ascii.c \
asyn-ares.c asyn-thread.c curl_gssapi.c curl_ntlm.c curl_ntlm_wb.c \
curl_ntlm_core.c curl_ntlm_msgs.c curl_sasl.c curl_schannel.c \
- curl_multibyte.c
+ curl_multibyte.c curl_darwinssl.c
HHEADERS = arpa_telnet.h netrc.h file.h timeval.h qssl.h hostip.h \
progress.h formdata.h cookie.h http.h sendf.h ftp.h url.h dict.h \
@@ -41,4 +41,4 @@ HHEADERS = arpa_telnet.h netrc.h file.h timeval.h qssl.h hostip.h \
warnless.h curl_hmac.h polarssl.h curl_rtmp.h curl_gethostname.h \
gopher.h axtls.h cyassl.h http_proxy.h non-ascii.h asyn.h curl_ntlm.h \
curl_gssapi.h curl_ntlm_wb.h curl_ntlm_core.h curl_ntlm_msgs.h \
- curl_sasl.h curl_schannel.h curl_multibyte.h
+ curl_sasl.h curl_schannel.h curl_multibyte.h curl_darwinssl.h
Oops, something went wrong.

0 comments on commit 6d1ea38

Please sign in to comment.