I have multiple links from imgur with HTTPS (e.g https://i.imgur.com/DMKPbRe.jpg). I'm using this as one of my background for my protoype app, but whenever I run it on my iPhone 7 physical device, the app crushes with error code 1200. Actual error is below:
2019-01-22 19:36:54.402391+0800 App[00000:0000000] Task <00000000000000000000>.<2> load failed with error Error Domain=NSURLErrorDomain Code=-1200 "An SSL error has occurred and a secure connection to the server cannot be made." UserInfo={NSErrorFailingURLStringKey=https://i.imgur.com/DMKPbRe.jpg, NSLocalizedRecoverySuggestion=Would you like to connect to the server anyway?, _kCFStreamErrorDomainKey=3, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <00000000000000000>.<2>, _NSURLErrorRelatedURLSessionTaskErrorKey=(
"LocalDataTask <0000000000000>.<2>"), NSLocalizedDescription=An SSL error has occurred and a secure connection to the server cannot be made., NSErrorFailingURLKey=https://i.imgur.com/DMKPbRe.jpg, NSUnderlyingError=0x2824d4150 {Error Domain=kCFErrorDomainCFNetwork Code=-1200 "(null)" UserInfo={_kCFStreamPropertySSLClientCertificateState=0, _kCFNetworkCFStreamSSLErrorOriginalValue=-9816, _kCFStreamErrorDomainKey=3, _kCFStreamErrorCodeKey=-9816}}, _kCFStreamErrorCodeKey=-9816} [-1200]
Code used to retrieve url:
let imgURL = URL(string: "https://i.imgur.com/DMKPbRe.jpg")
let imgImageView = UIImageView()
imgImageView.kf.setImage(with: imgURL) { (img, err, cacheType, url) in
if img == nil {
// TODO: add placeholder image when url didn't loaded
}
let imgTexture = SKTexture(image: img!)
self.img = SKSpriteNode(texture: imgTexture)
}
I don't want to turn off App Transport Security as I don't want to possibly mess up Apple's security for apps developed in Xcode
nscurl --ats-diagnostics https://i.imgur.com/DMKPbRe.jpg
– Matsimgur
doesn't supportTLSv1.3
. – user28434'mstep