我正在尝试与Instagram API建立SSL连接。
我知道网址有效,因为我检查了Chrome
Alamofire.request(.GET, instagramURL)
.responseJSON { response in
debugPrint(response)
}
我得到的错误是:
FAILURE: Error Domain=NSURLErrorDomain Code=-1200 "An SSL error has occurred and a secure connection to the server cannot be made." UserInfo={NSURLErrorFailingURLPeerTrustErrorKey=, NSLocalizedRecoverySuggestion=Would you like to connect to the server anyway?, _kCFStreamErrorDomainKey=3, _kCFStreamErrorCodeKey=-9802, NSErrorPeerCertificateChainKey={type = immutable, count = 2, values = ( 0 : 1 : )}, NSUnderlyingError=0x7fb07a478f80 {Error Domain=kCFErrorDomainCFNetwork Code=-1200 "(null)" UserInfo={_kCFStreamPropertySSLClientCertificateState=0, kCFStreamPropertySSLPeerTrust=, _kCFNetworkCFStreamSSLErrorOriginalValue=-9802, _kCFStreamErrorDomainKey=3, _kCFStreamErrorCodeKey=-9802, kCFStreamPropertySSLPeerCertificates={type = immutable, count = 2, values = ( 0 : 1 : )}}}, NSLocalizedDescription=An SSL error has occurred and a secure connection to the server cannot be made., NSErrorFailingURLKey=https://api.instagram.com/v1/users/26207120?client_id=*********************, NSErrorFailingURLStringKey=https://api.instagram.com/v1/users/26207120?client_id=*********************, NSErrorClientCertificateStateKey=0}
我该如何解决这个问题?