不幸的是今天早上我的XCode更新到版本7,我用http开发的iOS应用程序现在想要https.因此,在许多教程之后,我配置了我的MAMP服务器,以便使用https / ssl创建虚拟证书.现在在我的iOS应用中,URL如下所示:
@H_301_2@static var webServerLoginURL = "https://localhost:443/excogitoweb/mobile/loginM.PHP"
static var webServerGetUserTasks = "https://localhost:443/excogitoweb/mobile/handleTasks.PHP"
static var webServerGetUsers = "https://localhost:443/excogitoweb/mobile/handleUsers.PHP"
static var webServerGetProjects = "https://localhost:443/excogitoweb/mobile/handleProjects.PHP"
如果我尝试在浏览器中访问它们,它们工作正常.
我习惯使用NSURLSession.sharedSession().dataTaskWithRequest()来访问数据库和PHP文件,现在它会引发标题中的错误.例如,这是引发错误的行:
这是完整的错误消息:
@H_301_2@2015-09-21 16:41:48.354 ExcogitoWeb[75200:476213] CFNetwork SSLHandshake Failed (-9824) 2015-09-21 16:41:48.355 ExcogitoWeb[75200:476213] NSURLSession/NSURLConnection HTTP load Failed (kcfStreamErrorDomainSSL,-9824) fatal error: unexpectedly found nil while unwrapping an Optional value我想知道如何解决这个问题.我在这里已经阅读了一些有用的答案,但有许多事情我仍然不明白,如果有人愿意帮助/解释我,我将非常感激.