cURL / Mailing Lists / curl-library / Single Mail

curl-library

--with-darwinssl on iOS ?

From: Paul Joyce <pjoyce_at_we-do-it.com>
Date: Tue, 9 Apr 2013 07:54:16 +0000

I have configured curl to use darwinssl, and here is the report (for the simulator config, but device config is the same):
  curl version: 7.28.0
  Host setup: i386-apple-darwin
  Install prefix: /usr/local
  Compiler: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/llvm-gcc-4.2
  SSL support: enabled (iOS/Mac OS X-native)
  SSH support: no (--with-libssh2)
  zlib support: enabled
  krb4 support: no (--with-krb4*)
  GSSAPI support: no (--with-gssapi)
  SPNEGO support: no (--with-spnego)
  TLS-SRP support: no (--enable-tls-srp)
  resolver: default (--enable-ares / --enable-threaded-resolver)
  ipv6 support: no (--enable-ipv6)
  IDN support: no (--with-{libidn,winidn})
  Build libcurl: Shared=no, Static=yes
  Built-in manual: no (--enable-manual)
  --libcurl option: enabled (--disable-libcurl-option)
  Verbose errors: enabled (--disable-verbose)
  SSPI support: no (--enable-sspi)
  ca cert bundle: no
  ca cert path: no
  LDAP support: no (--enable-ldap / --with-ldap-lib / --with-lber-lib)
  LDAPS support: no (--enable-ldaps)
  RTSP support: no (--enable-rtsp)
  RTMP support: no (--with-librtmp)
  metalink support: no (--with-libmetalink)
  Protocols: FILE HTTP HTTPS

It says HTTPS is in the list, so configure was happy enough.

When I attempt to compile, I get an error
..../curl-7.28.0/lib/curl_darwinssl.c:905:6: Use of undeclared identifier 'SecTrustEvaluateAsync'; did you mean 'SecTrustEvaluate'?

The line is:
#if defined(__MAC_10_7) || defined(__IPHONE_5_0)
  if(SecTrustEvaluateAsync != NULL) {

From http://opensource.apple.com/source/libsecurity_keychain/libsecurity_keychain-55029/lib/SecTrust.h is the declaration of SecTrustEvaluateAsync

#ifdef __BLOCKS__
/*!
        @function SecTrustEvaluateAsync
        @abstract Evaluates a trust reference asynchronously.
        @param trust A reference to the trust object to evaluate.
        @param queue A dispatch queue on which the result callback should be
        executed. Pass NULL to use the current dispatch queue.
        @param result A SecTrustCallback block which will be executed when the
        trust evaluation is complete.
        @result A result code. See "Security Error Codes" (SecBase.h).
*/
OSStatus SecTrustEvaluateAsync(SecTrustRef trust,
        dispatch_queue_t queue, SecTrustCallback result)
    __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
#endif

Note that it says __IPHONE_NA. I assume that means it's not available on iOS, and that corresponds with the error from the compiler.

My question is can I get this to compile on iOS? The source says
#if defined(__MAC_10_7) || defined(__IPHONE_5_0)
so it seems to think it can compile on iOS.

Thanks, Paul

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2013-04-09