2016-12-26 135 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。
相關問題