Skip to content

Commit

Permalink
Added allowsInvalidCertificate for invalid https certificates
Browse files Browse the repository at this point in the history
  • Loading branch information
Josip Bernat committed Nov 18, 2014
1 parent 0abeeea commit 0eec5e0
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 14 deletions.
6 changes: 3 additions & 3 deletions JBMessage.podspec
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
Pod::Spec.new do |s|
s.name = "JBMessage"
s.version = "1.0.17"
s.version = "1.0.18"
s.summary = "JBMessage is simple iOS networking wrapper based on AFNetworking"
s.homepage = "https://github.com/josipbernat/JBMessage"
s.license = { :type => "MIT", :file => "LICENSE" }
s.author = { "Josip Bernat" => "[email protected]" }
s.social_media_url = "http://twitter.com/josipbernat"
s.platform = :ios, "6.0"
s.source = { :git => "https://github.com/josipbernat/JBMessage.git", :tag => "v1.0.17" }
s.source = { :git => "https://github.com/josipbernat/JBMessage.git", :tag => "v1.0.18" }
s.source_files = 'JBMessage/JBMessage/**/*.{h,m}'
s.requires_arc = true
s.dependency "AFNetworking", "~> 2.4"
s.dependency "AFNetworking", "~> 2.5"
end

2 changes: 2 additions & 0 deletions JBMessage.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,7 @@
};
1F3B320218E387DF000422F5 /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = AA1E78719F2B7E60B0241EA5 /* Pods.debug.xcconfig */;
buildSettings = {
BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/JBMessage.app/JBMessage";
FRAMEWORK_SEARCH_PATHS = (
Expand All @@ -503,6 +504,7 @@
};
1F3B320318E387DF000422F5 /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 4358A0A6A1532087BB87DD46 /* Pods.release.xcconfig */;
buildSettings = {
BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/JBMessage.app/JBMessage";
FRAMEWORK_SEARCH_PATHS = (
Expand Down
5 changes: 5 additions & 0 deletions JBMessage/JBMessage/JBMessage.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,11 @@ typedef void (^JBDownloadBlock)(NSUInteger bytesRead, long long totalBytesRead,
*/
@property (nonatomic, readwrite) BOOL shouldContinueAsBackgroundTask;

/**
* Boolean value determening wheter operation should allow invalid (https) certificates. Default value is NO.
*/
@property (nonatomic, readwrite) BOOL allowsInvalidCertificates;

/**
* A file URL for the multipart request. Deprecated from V.1.0.9. See inputFileURL and outputFileStreamPath.
*/
Expand Down
4 changes: 4 additions & 0 deletions JBMessage/JBMessage/JBMessage.m
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,10 @@ - (void)executeRequest {
NSURLRequest *request = [self urlRequest];
AFHTTPRequestOperationManager *manager = [self requestOperationManager];

if (self.allowsInvalidCertificates) {
manager.securityPolicy.allowInvalidCertificates = YES;
}

__weak id this = self;
AFHTTPRequestOperation *operation = [manager HTTPRequestOperationWithRequest:request
success:^(AFHTTPRequestOperation *operation, id responseObject) {
Expand Down
2 changes: 1 addition & 1 deletion Podfile
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
platform :ios, '6.0'
pod 'AFNetworking', '~> 2.4'
pod 'AFNetworking', '~> 2.5'
20 changes: 10 additions & 10 deletions Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
PODS:
- AFNetworking (2.4.1):
- AFNetworking (2.5.0):
- AFNetworking/NSURLConnection
- AFNetworking/NSURLSession
- AFNetworking/Reachability
- AFNetworking/Security
- AFNetworking/Serialization
- AFNetworking/UIKit
- AFNetworking/NSURLConnection (2.4.1):
- AFNetworking/NSURLConnection (2.5.0):
- AFNetworking/Reachability
- AFNetworking/Security
- AFNetworking/Serialization
- AFNetworking/NSURLSession (2.4.1):
- AFNetworking/NSURLSession (2.5.0):
- AFNetworking/Reachability
- AFNetworking/Security
- AFNetworking/Serialization
- AFNetworking/Reachability (2.4.1)
- AFNetworking/Security (2.4.1)
- AFNetworking/Serialization (2.4.1)
- AFNetworking/UIKit (2.4.1):
- AFNetworking/Reachability (2.5.0)
- AFNetworking/Security (2.5.0)
- AFNetworking/Serialization (2.5.0)
- AFNetworking/UIKit (2.5.0):
- AFNetworking/NSURLConnection
- AFNetworking/NSURLSession

DEPENDENCIES:
- AFNetworking (~> 2.4)
- AFNetworking (~> 2.5)

SPEC CHECKSUMS:
AFNetworking: 0aabc6fae66d6e5d039eeb21c315843c7aae51ab
AFNetworking: 0f54cb5d16ce38c1b76948faffb8d5fb705021c7

COCOAPODS: 0.34.1
COCOAPODS: 0.34.4

0 comments on commit 0eec5e0

Please sign in to comment.