3

I'm using OS X Server 4.1.3 and an iPhone 6 with iOS9 Beta-4.

When I try to connect to the OS X Server ("skw.local") with

let urlPath: String = "https://skw.local/"
let url: NSURL = NSURL(string: urlPath)!
let request: NSMutableURLRequest = NSMutableURLRequest(URL: url)
let sessionConfig = NSURLSessionConfiguration.defaultSessionConfiguration()
let sesh = NSURLSession(configuration: sessionConfig)
let task = sesh.dataTaskWithRequest(request) {(data, response, error) -> Void in
     if error == nil {
          print("Response: \(response)")
     }
     else {
          print(error, appendNewline: true)
     }
}
task.resume()

I get the following error:

NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9813)
You might be connecting to a server that is pretending to be “skw.local” which could put your confidential information at risk."

I have tried bypassing the NSAppTransportSecurity requirements by adding the following to my Info.plist:

<key>NSAppTransportSecurity</key>
<dict>
     <key>NSAllowsArbitraryLoads</key><true/>
</dict>

but I get the same errors.

Anyone else having similar trouble?

edit: I also posted this over on apple's dev forum

sawyer
  • 300
  • 1
  • 4
  • 15
  • Does it work with the previous SDKs? Thanks – rholmes Jul 29 '15 at 22:21
  • Yes I've connected to the OS X Server with Swift 1.2 in the past, with a self-signed certificate installed on the dev device. But now I have a few devices that I'm testing the app on, and wanted to avoid needing to install the cert on each one. – sawyer Jul 29 '15 at 22:34
  • Can't test it myself, but does this help? http://stackoverflow.com/a/32770621/2494219 – Devran Cosmo Uenal Nov 28 '15 at 21:34

0 Answers0