gpt4 book ai didi

iOS 应用程序传输安全和 Instagram 媒体 CDN

转载 作者:塔克拉玛干 更新时间:2023-11-02 10:00:20 37 4
gpt4 key购买 nike

我正在更新我的 iOS 应用程序,该应用程序从适用于 iOS v[redacted] 的 Instagram 中提取图像。有一项新功能可以加强网络安全。它妨碍了我使用以下 NSError 获取 Instagram:

Description: {
NSErrorFailingURLKey = "https:/instagram.com/p/52A5mtpurv/media/?size=l";
NSErrorFailingURLStringKey = "https:/instagram.com/p/52A5mtpurv/media/?size=l";
NSLocalizedDescription = "An SSL error has occurred and a secure connection to the server cannot be made.";
NSLocalizedRecoverySuggestion = "Would you like to connect to the server anyway?";
NSURLErrorFailingURLPeerTrustErrorKey = "<SecTrustRef: 0x17b1ebe0>";
NSUnderlyingError = "Error Domain=kCFErrorDomainCFNetwork Code=-1200 \"An SSL error has occurred and a secure connection to the server cannot be made.\" UserInfo={NSLocalizedDescription=An SSL error has occurred and a secure connection to the server cannot be made., _kCFNetworkCFStreamSSLErrorOriginalValue=-9802, _kCFStreamPropertySSLClientCertificateState=0, NSLocalizedRecoverySuggestion=Would you like to connect to the server anyway?, _kCFStreamErrorCodeKey=-9802, kCFStreamPropertySSLPeerTrust=<SecTrustRef: 0x17b1ebe0>, _kCFStreamErrorDomainKey=3, NSErrorFailingURLStringKey=https://igcdn-photos-f-a.akamaihd.net/hphotos-ak-xaf1/t51.2885-15/11375272_1120995804579077_1215796842_n.jpg, NSErrorFailingURLKey=https://igcdn-photos-f-a.akamaihd.net/hphotos-ak-xaf1/t51.2885-15/11375272_1120995804579077_1215796842_n.jpg}";
"_kCFStreamErrorCodeKey" = "-9802";
"_kCFStreamErrorDomainKey" = 3;
}

简单的答案是禁用新的安全功能。许多人显然正在采用这种方法。我认为这是不明智的。

阅读以上错误,很明显,位于 akamaihd.net 的 Akamai CDN 和 Instagram 正在联合显示问题。

我在 info.plist 中做了以下异常声明:

<key>NSAppTransportSecurity</key>
<dict>
<key>NSExceptionDomains</key>
<dict>
<key>instagram.com</key>
<dict>
<key>NSExceptionAllowInsecureHTTPSLoads</key>
<true/>
<key>NSExceptionRequiresForwardSecrecy</key>
<false/>
<key>NSExceptionMinimumTLSVersion</key>
<string>TLSv1.0</string>
<key>NSThirdPartyExceptionAllowsInsecureHTTPLoads</key>
<true/>
<key>NSThirdPartyExceptionRequiresForwardSecrecy</key>
<false/>
<key>NSThirdPartyExceptionMinimumTLSVersion</key>
<string>TLSv1.0</string>
</dict>
</dict>

上面的异常没有完成这项工作。关于如何进行的任何想法?同样,禁用新的安全功能并不能解决处理通过 CDN 运行的公共(public)服务的问题。

最佳答案

问题是我的代码中有一个激进的斜线缩减器。它将 https:// 折叠为 https:/。那导致了错误。

关于iOS 应用程序传输安全和 Instagram 媒体 CDN,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31763113/

37 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com