Advertisement
Guest User

Untitled

a guest
Apr 19th, 2014
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.74 KB | None | 0 0
  1. AFSecurityPolicy *policy = [AFSecurityPolicy policyWithPinningMode:AFSSLPinningModeNone];
  2. [policy setAllowInvalidCertificates:YES];
  3.  
  4. AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];
  5. [manager setResponseSerializer:[AFHTTPResponseSerializer serializer]];
  6. [manager setRequestSerializer:[AFJSONRequestSerializer serializer]];
  7. [manager setSecurityPolicy:policy];
  8.  
  9. [manager POST:url
  10. parameters:dictionary
  11. success:^(AFHTTPRequestOperation *operation, id responseObject) {
  12. // Process Response Object
  13. NSLog(@"JSON: %@", [responseObject description]);
  14.  
  15. } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
  16. // Handle Error
  17. NSLog(@"Failure Error: %@", [error description]);
  18. }];
  19.  
  20. 2014-04-10 15:05:40.412 https_AF2[5548:3607] CFNetwork SSLHandshake failed (-9800)
  21. 2014-04-10 15:05:41.092 https_AF2[5548:3607] CFNetwork SSLHandshake failed (-9800)
  22. 2014-04-10 15:05:41.732 https_AF2[5548:3607] CFNetwork SSLHandshake failed (-9800)
  23. 2014-04-10 15:05:41.734 https_AF2[5548:3607] NSURLConnection/CFURLConnection HTTP load failed
  24. (kCFStreamErrorDomainSSL, -9800)
  25. 2014-04-10 15:05:41.736 https_AF2[5548:60b] Failure Error: Error Domain=NSURLErrorDomain
  26. Code=-1200 "An SSL error has occurred and a secure connection to the server cannot be made."
  27. UserInfo=0x8d6af80
  28. {NSErrorFailingURLStringKey=https://(myUrl)/userLogin,
  29. NSLocalizedRecoverySuggestion=Would you like to connect to the server anyway?,
  30. NSErrorFailingURLKey=https://(myUrl)/userLogin,
  31. NSLocalizedDescription=An SSL error has occurred and a secure connection to the server cannot be made.,
  32. NSUnderlyingError=0x8cb4920 "An SSL error has occurred and a secure connection to the server cannot be made."}
  33.  
  34. policy.validatesDomainName = NO;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement