{"id":256498,"date":"2015-05-03T04:02:02","date_gmt":"2015-05-03T00:02:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=256498"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=256498","title":{"rendered":"\u041e\u0448\u0438\u0431\u043a\u0430 \u0432 \u043a\u043e\u0434\u0435 AFNetworking \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442\u044b\u0432\u0430\u0442\u044c HTTPS \u0442\u0440\u0430\u0444\u0438\u043a \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439"},"content":{"rendered":"<p>     \t\u0412 \u043e\u0434\u043d\u043e\u043c \u0438\u0437 \u0441\u0430\u043c\u044b\u0445 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0445 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u043e\u0432 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0441\u0435\u0442\u044c\u044e \u0432 iOS \u0438 OS X \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u0445 \u0431\u044b\u043b\u0430 \u043d\u0430\u0439\u0434\u0435\u043d\u0430 \u043a\u0440\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0443\u044f\u0432\u0438\u043c\u043e\u0441\u0442\u044c. \u041f\u043e\u0434 \u043f\u0440\u0438\u0446\u0435\u043b\u043e\u043c \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0441\u0442\u043e\u0432 \u0438\u0437 Minded Security \u043e\u043a\u0430\u0437\u0430\u043b\u0441\u044f <a href=\"https:\/\/github.com\/AFNetworking\/AFNetworking\">AFNetworking<\/a>, \u0430 \u0438\u043c\u0435\u043d\u043d\u043e \u0432\u0435\u0440\u0441\u0438\u044f 2.5.1. <\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/219\/a3e\/9cc\/219a3e9cc05ec89872eb82b66ceed7e5.png\" alt=\"image\"\/><br \/>  <a name=\"habracut\"><\/a><br \/>  \u0412 \u043c\u0435\u0442\u043e\u0434\u0435 evaluateServerTrust (\u0444\u0430\u0439\u043b AFSecurityPolicy.m) \u043f\u0440\u043e\u0438\u0445\u043e\u0434\u0438\u0442 \u043b\u043e\u0433\u0438\u043a\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 SSL \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u0430.  <\/p>\n<pre><code class=\"cpp\">- (BOOL)evaluateServerTrust:(SecTrustRef)serverTrust       forDomain:(NSString *)domain {   NSMutableArray *policies = [NSMutableArray array];   if (self.validatesDomainName) {      [policies addObject:(__bridge_transfer id)SecPolicyCreateSSL(true, (__bridge CFStringRef)domain)];   } else {      [policies addObject:(__bridge_transfer id)SecPolicyCreateBasicX509()];   }    SecTrustSetPolicies(serverTrust, (__bridge CFArrayRef)policies);    if (self.SSLPinningMode != AFSSLPinningModeNone &&  !AFServerTrustIsValid(serverTrust) &&  !self.allowInvalidCertificates) {    return NO;  }   NSArray *serverCertificates = AFCertificateTrustChainForServerTrust(serverTrust);     switch (self.SSLPinningMode) {         case AFSSLPinningModeNone:             return YES; <\/code><\/pre>\n<p>  \u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e SSLPinningMode \u0432\u044b\u0441\u0442\u0430\u0432\u043b\u0435\u043d \u0432 AFSSLPinningModeNone, \u0447\u0442\u043e \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u043e\u0442\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u0430. \u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u044d\u0442\u043e\u043c\u0443, \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u0435\u043d <a href=\"https:\/\/ru.wikipedia.org\/wiki\/%D0%A7%D0%B5%D0%BB%D0%BE%D0%B2%D0%B5%D0%BA_%D0%BF%D0%BE%D1%81%D0%B5%D1%80%D0%B5%D0%B4%D0%B8%D0%BD%D0%B5\">SSL MITM<\/a>. <br \/>  \u0414\u0430\u043d\u043d\u044b\u0439 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u0435\u043d. \u0415\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u0442\u0430\u043a\u0438\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043a\u0430\u043a Pinterest, Heroku, Citrix OpenVoice Audio Conferencing, Alibaba \u0438 \u0434\u0440\u0443\u0433\u0438\u0435. <\/p>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438 \u0434\u0435\u0442\u0430\u043b\u0435\u0439 \u0443\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u0438 \u0431\u044b\u043b\u0438 \u043f\u0440\u043e\u0432\u0435\u0434\u0435\u043d\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0434\u0440\u0443\u0433\u0438\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0438\u0437 AppleStore. \u0420\u0435\u0437\u0443\u043b\u044c\u0430\u0442\u0430\u0442\u044b \u043d\u0435 \u0443\u0442\u0438\u0448\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435. 1500 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u043e\u043a\u0430\u0437\u0430\u043b\u0438\u0441\u044c \u043f\u043e\u0434 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435\u043c \u00ab\u0434\u044b\u0440\u044f\u0432\u043e\u0439\u00bb \u0432\u0435\u0440\u0441\u0438\u0438 AFNetworking.<br \/>  \u0421\u043b\u0435\u0434\u043e\u043c \u0431\u044b\u043b \u0437\u0430\u043f\u0443\u0449\u0435\u043d \u0441\u0435\u0440\u0432\u0438\u0441 \u0434\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u043d\u0430 \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u0443\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u0438: <a href=\"http:\/\/searchlight.sourcedna.com\/lookup\">searchlight.sourcedna.com\/lookup<\/a><br \/>  \u0412 \u0432\u0435\u0440\u0441\u0438\u0438 2.5.2 \u0431\u0430\u0433\u0430 \u0447\u0430\u0441\u0442\u0438\u0447\u043d\u043e \u0437\u0430\u043a\u0440\u044b\u0442\u0430, \u043d\u043e \u043f\u043e \u043f\u0440\u0435\u0436\u0434\u043d\u0435\u043c\u0443 \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u043e\u0431\u0445\u043e\u0434 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438 \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u0430 \u0438\u0437-\u0437\u0430 \u043e\u0442\u0441\u0442\u0443\u0442\u0441\u0432\u0438\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0445\u043e\u0441\u0442\u0430.<\/p>\n<p>  \u0421\u0441\u044b\u043b\u043a\u0438 \u043f\u043e \u0442\u0435\u043c\u0435: <br \/>  <a href=\"http:\/\/blog.mindedsecurity.com\/2015\/03\/ssl-mitm-attack-in-afnetworking-251-do.html\">SSL MiTM attack in AFNetworking 2.5.1 \u2014 Do NOT use it in production!<\/a><br \/>  <a href=\"http:\/\/arstechnica.com\/security\/2015\/04\/20\/1500-ios-apps-have-https-crippling-bug-is-one-of-them-on-your-device\/\">1,500 iOS apps have HTTPS-crippling bug. Is one of them on your device?<\/a>     \t<\/p>\n<div class=\"clear\"><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/257163\/\"> http:\/\/habrahabr.ru\/post\/257163\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>     \t\u0412 \u043e\u0434\u043d\u043e\u043c \u0438\u0437 \u0441\u0430\u043c\u044b\u0445 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0445 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u043e\u0432 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0441\u0435\u0442\u044c\u044e \u0432 iOS \u0438 OS X \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u0445 \u0431\u044b\u043b\u0430 \u043d\u0430\u0439\u0434\u0435\u043d\u0430 \u043a\u0440\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0443\u044f\u0432\u0438\u043c\u043e\u0441\u0442\u044c. \u041f\u043e\u0434 \u043f\u0440\u0438\u0446\u0435\u043b\u043e\u043c \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0441\u0442\u043e\u0432 \u0438\u0437 Minded Security \u043e\u043a\u0430\u0437\u0430\u043b\u0441\u044f <a href=\"https:\/\/github.com\/AFNetworking\/AFNetworking\">AFNetworking<\/a>, \u0430 \u0438\u043c\u0435\u043d\u043d\u043e \u0432\u0435\u0440\u0441\u0438\u044f 2.5.1. <\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/219\/a3e\/9cc\/219a3e9cc05ec89872eb82b66ceed7e5.png\" alt=\"image\"\/>  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-256498","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/256498","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=256498"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/256498\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=256498"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=256498"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=256498"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}