2016-12-26 137 views
-1

我们正在使用IBM MobileFirst Platform Foundation v7.1开发应用程序。目前我们正处于UAT阶段。该应用程序支持Android和iOS。iOS中的证书锁定失败

我们为我们的应用程序实施了证书锁定。 MobileFirst Server由网络团队维护,它为我提供了一个带有“cer”扩展名的公共证书(com.uat.myapp.cer)。我将这个公共证书包含在证书文件夹下的项目中,并将证书固定代码写入main.js文件。

Android应用程序工作正常,并且正在与MobileFirst Server进行SSL握手。该应用程序正常工作。

iOS的应用程序,虽然不能与下面的错误连接到服务器MobileFirst:

An SSL error has occurred and a secure connection to the server cannot be made".

我转换.CER证书.der证书使用(com.uat.myapp.der)的以下门户网站:https://www.sslshopper.com/ssl-converter.html并将其放入应用程序中,但我仍然以相同的错误结束。

请找到下面的错误日志以了解更多信息:

-[WLAFHTTPRequestOperationManagerWrapper requestFailed:error:] in WLAFHTTPRequestOperationManagerWrapper.m:390 :: Response Error : An SSL error has occurred and a secure connection to the server cannot be made. 2016-12-26 19:38:49.301 MyApp[1419:26347] [DEBUG] [WORKLIGHT] 
+[WLClient sharedInstance] in WLClient.m:165 :: IBMMobilieFirstFoundation.framework version = 7.1-2016/05/28 17:08:17 

-[WLRequest requestFailed:error:] in WLRequest.m:509 :: Status code='0' error='An SSL error has occurred and a secure connection to the server cannot be made.' response='(null)' 

2016-12-26 19:38:49.302 MyApp[1419:26347] [DEBUG] [WL_REQUEST] 
-[WLRequest requestFailed:error:] in WLRequest.m:512 :: Response Header: (null) Response Data: (null) 

2016-12-26 19:38:49.302 MyApp[1419:26347] [DEBUG] [WL_AUTH] 
-[WLAuthorizationManager failRegistratioWithResponse:] in WLAuthorizationManager.m:866 :: Response does not contain a valid certificate and client Id. device registration failed 

2016-12-26 19:38:49.306 MyApp[1419:26347] [DEBUG] [CERTIFICATE_MANAGER] +[WLCertManager removeKey:] in WLCertManager.m:262 :: Key was successfully removed. 
+0

请确保您遵循服务器和客户端的文档中的说明:https://mobilefirstplatform.ibmcloud.com/blog/2015/08/14/certificate-pinning-in-ibm-mobilefirst -platform-foundation-7-1/- 还验证证书的有效性,特别是指定的主机和服务器真正匹配。 –

+1

首先,尝试不使用证书锁定。意思是将您的iOS应用程序连接到您的SSL服务器,而无需使用固定API。更新您的问题,让我们知道这个常规流程是否有效。 –

+0

@karthik_Chinna,请查看以上评论并回复。 –

回答

0

我的预感是,在证书中指定的域不匹配应用程序所使用的实际服务器主机或IP。

  1. 使用keytool验证证书是否确实包含所需的主机/ ip值。
  2. 在您的应用程序中,确保应用程序确实尝试连接到相同的服务器主机/ IP。
相关问题