Could not download and install iOS 9.3 Simulator. The certificate for this server is invalid. You might be connecting to a server that is pretending to be “devimages.apple.com.edgekey.net” which could put your confidential information at risk.

升级到Xcode9.0以后,去下载模拟器,发现提示“Could not download and install iOS 9.3 Simulator. The certificate for this server is invalid. You might be connecting to a server that is pretending to be “devimages.apple.com.edgekey.net” which could put your confidential information at risk.”的错误

看起来是个https证书验证的问题,那怎么做呢?

  1. 通过终端命令打开Xcode
sudo /Applications/Xcode.app/Contents/MacOS/Xcode
  1. 打开下载模拟器的窗口Xcode-Preferences-Components点击iOS9.3 Simulator,弹出窗口,提示警告。
  2. 查看终端的输出
2017-09-30 13:43:09.368 Xcode[3443:318102] NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9843)
2017-09-30 13:43:09.372 Xcode[3443:318051] [MT] DVTDownloadable: Error Domain=NSURLErrorDomain Code=-1202 "Could not download and install iOS 9.3 Simulator. The certificate for this server is invalid. You might be connecting to a server that is pretending to be “devimages.apple.com.edgekey.net” which could put your confidential information at risk." UserInfo={NSURLErrorFailingURLPeerTrustErrorKey=<SecTrustRef: 0x7f9c412b1dc0>, NSLocalizedRecoverySuggestion=Would you like to connect to the server anyway?, NSErrorFailingURLKey=https://devimages.apple.com.edgekey.net/downloads/xcode/simulators/com.apple.pkg.iPhoneSimulatorSDK9_3-9.3.1.1460411551.dmg, NSErrorFailingURLStringKey=https://devimages.apple.com.edgekey.net/downloads/xcode/simulators/com.apple.pkg.iPhoneSimulatorSDK9_3-9.3.1.1460411551.dmg, NSErrorPeerCertificateChainKey=(
    "<cert(0x7f9c5e340200) s: *.test.edgekey.net i: Symantec Class 3 Secure Server CA - G4>",
    "<cert(0x7f9c5e340c00) s: Symantec Class 3 Secure Server CA - G4 i: VeriSign Class 3 Public Primary Certification Authority - G5>"
), NSErrorClientCertificateStateKey=0, NSLocalizedDescription=Could not download and install iOS 9.3 Simulator. The certificate for this server is invalid. You might be connecting to a server that is pretending to be “devimages.apple.com.edgekey.net” which could put your confidential information at risk., _kCFStreamErrorDomainKey=3, NSUnderlyingError=0x7f9c41374bc0 {Error Domain=kCFErrorDomainCFNetwork Code=-1202 "The certificate for this server is invalid. You might be connecting to a server that is pretending to be “devimages.apple.com.edgekey.net” which could put your confidential information at risk." UserInfo={NSErrorFailingURLStringKey=https://devimages.apple.com.edgekey.net/downloads/xcode/simulators/com.apple.pkg.iPhoneSimulatorSDK9_3-9.3.1.1460411551.dmg, NSLocalizedRecoverySuggestion=Would you like to connect to the server anyway?, _kCFNetworkCFStreamSSLErrorOriginalValue=-9843, kCFStreamPropertySSLPeerCertificates=(
    "<cert(0x7f9c5e340200) s: *.test.edgekey.net i: Symantec Class 3 Secure Server CA - G4>",
    "<cert(0x7f9c5e340c00) s: Symantec Class 3 Secure Server CA - G4 i: VeriSign Class 3 Public Primary Certification Authority - G5>"
), _kCFStreamPropertySSLClientCertificateState=0, kCFStreamPropertySSLPeerTrust=<SecTrustRef: 0x7f9c412b1dc0>, NSLocalizedDescription=The certificate for this server is invalid. You might be connecting to a server that is pretending to be “devimages.apple.com.edgekey.net” which could put your confidential information at risk., _kCFStreamErrorDomainKey=3, NSErrorFailingURLKey=https://devimages.apple.com.edgekey.net/downloads/xcode/simulators/com.apple.pkg.iPhoneSimulatorSDK9_3-9.3.1.1460411551.dmg, _kCFStreamErrorCodeKey=-9843}}, _kCFStreamErrorCodeKey=-9843}
2017-09-30 13:43:09.372 Xcode[3443:318066]  DVTDownloadable: Download Failed. Downloadable: https://devimages.apple.com.edgekey.net/downloads/xcode/simulators/com.apple.pkg.iPhoneSimulatorSDK9_3-9.3.1.1460411551.dmg. Error Domain=NSURLErrorDomain Code=-1202 "The certificate for this server is invalid. You might be connecting to a server that is pretending to be “devimages.apple.com.edgekey.net” which could put your confidential information at risk." UserInfo={NSURLErrorFailingURLPeerTrustErrorKey=<SecTrustRef: 0x7f9c412b1dc0>, NSLocalizedRecoverySuggestion=Would you like to connect to the server anyway?, _kCFStreamErrorDomainKey=3, _kCFStreamErrorCodeKey=-9843, NSErrorPeerCertificateChainKey=(
    "<cert(0x7f9c5e340200) s: *.test.edgekey.net i: Symantec Class 3 Secure Server CA - G4>",
    "<cert(0x7f9c5e340c00) s: Symantec Class 3 Secure Server CA - G4 i: VeriSign Class 3 Public Primary Certification Authority - G5>"
), NSUnderlyingError=0x7f9c41374bc0 {Error Domain=kCFErrorDomainCFNetwork Code=-1202 "The certificate for this server is invalid. You might be connecting to a server that is pretending to be “devimages.apple.com.edgekey.net” which could put your confidential information at risk." UserInfo={NSErrorFailingURLStringKey=https://devimages.apple.com.edgekey.net/downloads/xcode/simulators/com.apple.pkg.iPhoneSimulatorSDK9_3-9.3.1.1460411551.dmg, NSLocalizedRecoverySuggestion=Would you like to connect to the server anyway?, _kCFNetworkCFStreamSSLErrorOriginalValue=-9843, kCFStreamPropertySSLPeerCertificates=(
    "<cert(0x7f9c5e340200) s: *.test.edgekey.net i: Symantec Class 3 Secure Server CA - G4>",
    "<cert(0x7f9c5e340c00) s: Symantec Class 3 Secure Server CA - G4 i: VeriSign Class 3 Public Primary Certification Authority - G5>"
), _kCFStreamPropertySSLClientCertificateState=0, kCFStreamPropertySSLPeerTrust=<SecTrustRef: 0x7f9c412b1dc0>, NSLocalizedDescription=The certificate for this server is invalid. You might be connecting to a server that is pretending to be “devimages.apple.com.edgekey.net” which could put your confidential information at risk., _kCFStreamErrorDomainKey=3, NSErrorFailingURLKey=https://devimages.apple.com.edgekey.net/downloads/xcode/simulators/com.apple.pkg.iPhoneSimulatorSDK9_3-9.3.1.1460411551.dmg, _kCFStreamErrorCodeKey=-9843}}, NSLocalizedDescription=The certificate for this server is invalid. You might be connecting to a server that is pretending to be “devimages.apple.com.edgekey.net” which could put your confidential information at risk., NSErrorFailingURLKey=https://devimages.apple.com.edgekey.net/downloads/xcode/simulators/com.apple.pkg.iPhoneSimulatorSDK9_3-9.3.1.1460411551.dmg, NSErrorFailingURLStringKey=https://devimages.apple.com.edgekey.net/downloads/xcode/simulators/com.apple.pkg.iPhoneSimulatorSDK9_3-9.3.1.1460411551.dmg, NSErrorClientCertificateStateKey=0}
2017-09-30 13:55:29.805 Xcode[3443:318051] Unknown class GPUTesselationSliderCell in Interface Builder file.
2017-09-30 13:55:34.791 Xcode[3443:318051] Could not find image named 'DVTInFieldChooseButtonSmall'.
2017-09-30 13:55:35.089 Xcode[3443:318051] [MT] DVTAssertions: Warning in /Library/Caches/com.apple.xbs/Sources/IDEFrameworks/IDEFrameworks-13247/IDEKit/NavigableItems/IDENavigableItem.m:1175
Details:  No match from <IDEKeyDrivenNavigableItem 0x7f9c5cb31960: (supports Any NSObject, represents: <Xcode3EditingGroup: 0x7f9c597a7200>)> to <Xcode3Target:0x7f9c5975de00:TestProject>. Iterating the whole tree might have taken a significant amount of time.
Object:   <IDEKeyDrivenNavigableItem_Xcode3EditingGroup_Any: 0x7f9c5cb31960>
Method:   -_descendantItemForRepresentedObject:stopAtClass:
Thread:   <NSThread: 0x7f9c50407620>{number = 1, name = main}
Please file a bug at http://bugreport.apple.com with this warning message and any useful information you can provide.
  1. 查看输出的下载地址https://devimages.apple.com.edgekey.net/downloads/xcode/simulators/com.apple.pkg.iPhoneSimulatorSDK9_3-9.3.1.1460411551.dmg,将下载地址 copy到浏览器中,发现提示
    截图-1.png

    点击访问此网站,既可以下载模拟器文件
  2. 将下载好的文件*.dmg拖到com.apple.dt.Xcode/Downloads文件夹中,通过终端open ~/Library/Caches,找到com.apple.dt.Xcode,点击右键,选择显示包内容,如果里面没有Downloads文件夹,则新建,完成后,将*.dmg拖到这里面
  3. 回到窗口Xcode-Preferences-Components,再次点击刚才点击过的iOS9.3 Simulator直接跳过下载,直接安装了。
  4. 在安装其他版本的模拟器,就可以直接在Xcode-Preferences-Components点击就能下载了,这算不算Apple的bug呢。
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容