germanattanasio / speech-ios-sdk

DEPRECATED - use https://github.com/watson-developer-cloud/ios-sdk
https://github.com/watson-developer-cloud/ios-sdk
Other
34 stars 15 forks source link

It doesn't work in xcode 7.0 #9

Closed germanattanasio closed 8 years ago

germanattanasio commented 8 years ago

Anton McConville said:

@germanatt: I’m seeing some linking funniness with the latest XCode - typical update changes that I’d > need to get a handle on. I downloaded XCode 6.4, and seem to be ok running from that but not 7.0. My > project has a lot of dependencies, so I’m not sure where the issue lies, although I wasn’t able to run the > Watson sdk from XCode 7 either.

zekizeki commented 8 years ago

I've updated to xcode7 and receive the following SSL error when running the sample code

2015-09-30 09:52:30.049 watsonsdktest[22866:520980] CFNetwork SSLHandshake failed (-9824) 2015-09-30 09:52:30.050 watsonsdktest[22866:520980] NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9824)

This appears to be caused by the new TLS 1.2 requirements in ios9

https://devcentral.f5.com/articles/preparing-your-f5-for-new-tls-requirements-in-apple-ios-9-and-os-x-1011

It can be worked around with the method described here http://stackoverflow.com/questions/30720813/cfnetwork-sslhandshake-failed-ios-9 but needs fixing at the server side.

I added this to the application sample .plist which resolves the SSL error.

<key>NSAppTransportSecurity</key>
    <dict>
        <key>NSExceptionDomains</key>
        <dict>
            <key>watsonplatform.net</key>
            <dict>
                <!--Include to allow subdomains-->
                <key>NSIncludesSubdomains</key>
                <true/>
                <key>NSTemporaryExceptionRequiresForwardSecrecy</key>
                <false/>
            </dict>
        </dict>
    </dict>

This needs a fix from the server side

antonmc commented 8 years ago

Finally restored my iOS9 working environment and tried the app using the workaround above.

I can confirm that it is working for me on the simulator at least ( I'll try on hardware later )

Thanks for the workaround :)