Skip to content

Commit

Permalink
Added support for disabling SSL validation.
Browse files Browse the repository at this point in the history
  • Loading branch information
nerdyc committed Aug 13, 2011
1 parent b68988d commit 1607ce6
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 0 deletions.
14 changes: 14 additions & 0 deletions VPLHTTPClient/Source/VPLASIHTTPRequest.m
Original file line number Diff line number Diff line change
Expand Up @@ -156,4 +156,18 @@ - (void)setRequestTimeout:(NSTimeInterval)requestTimeout
[[self _httpRequest] setTimeOutSeconds:requestTimeout];
}

// ===== VALIDATES SSL CERTIFICATES ====================================================================================
#pragma mark -
#pragma mark Validates SSL Certificates

- (BOOL)validatesSSLCertificates
{
return [[self _httpRequest] validatesSecureCertificate];
}

- (void)setValidatesSSLCertificates:(BOOL)validatesSSLCertificates
{
[[self _httpRequest] setValidatesSecureCertificate:validatesSSLCertificates];
}

@end
1 change: 1 addition & 0 deletions VPLHTTPClient/Source/VPLHTTPGenericRequest.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
NSString * _password;

NSTimeInterval _requestTimeout;
BOOL _validatesSSLCertificates;
}

- (id)initWithURLString:(NSString *)URLString;
Expand Down
7 changes: 7 additions & 0 deletions VPLHTTPClient/Source/VPLHTTPGenericRequest.m
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ - (id)initWithURLString:(NSString *)URLString
_requestURLString = [URLString retain];
_requestMethod = (requestMethod ? [requestMethod retain] : [@"GET" retain]);
_requestTimeout = 60.0;
_validatesSSLCertificates = YES;

}
return self;
Expand Down Expand Up @@ -112,4 +113,10 @@ - (void)setUsername:(NSString *)username

@synthesize requestTimeout = _requestTimeout;

// ===== VALIDATES SSL CERTIFICATES ====================================================================================
#pragma mark -
#pragma mark Validates SSL Certificates

@synthesize validatesSSLCertificates = _validatesSSLCertificates;

@end
4 changes: 4 additions & 0 deletions VPLHTTPClient/Source/VPLHTTPRequest.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,8 @@

@property (nonatomic,assign) NSTimeInterval requestTimeout;

// ===== VALIDATES SSL CERTIFICATES ====================================================================================

@property (nonatomic,assign) BOOL validatesSSLCertificates;

@end

0 comments on commit 1607ce6

Please sign in to comment.