Toggle navigation
Toggle navigation
This project
Loading...
Sign in
iOS
/
asi-http-request
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
Ben Copsey
2010-03-25 10:36:41 +0000
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
16eceb3322accef81734169ef8cfbbef9329e842
16eceb33
1 parent
5704fcd7
Hopefully fix https issues with proxies
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
2 deletions
Classes/ASIHTTPRequest.m
Classes/Tests/ProxyTests.h
Classes/Tests/ProxyTests.m
Classes/ASIHTTPRequest.m
View file @
16eceb3
...
...
@@ -23,7 +23,7 @@
// Automatically set on build
NSString
*
ASIHTTPRequestVersion
=
@"
v1.6-20 2010-03-24
"
;
NSString
*
ASIHTTPRequestVersion
=
@"
2010-03-25
"
;
NSString
*
const
NetworkRequestErrorDomain
=
@"ASIHTTPRequestErrorDomain"
;
...
...
@@ -897,7 +897,13 @@ static BOOL isiPhoneOS2;
}
}
if
([
self
proxyHost
]
&&
[
self
proxyPort
])
{
NSMutableDictionary
*
proxyToUse
=
[
NSMutableDictionary
dictionaryWithObjectsAndKeys
:[
self
proxyHost
],
kCFStreamPropertyHTTPProxyHost
,[
NSNumber
numberWithInt
:[
self
proxyPort
]],
kCFStreamPropertyHTTPProxyPort
,
nil
];
NSString
*
hostKey
=
(
NSString
*
)
kCFStreamPropertyHTTPProxyHost
;
NSString
*
portKey
=
(
NSString
*
)
kCFStreamPropertyHTTPProxyPort
;
if
([[[[
self
url
]
scheme
]
lowercaseString
]
isEqualToString
:
@"https"
])
{
hostKey
=
(
NSString
*
)
kCFStreamPropertyHTTPSProxyHost
;
portKey
=
(
NSString
*
)
kCFStreamPropertyHTTPSProxyPort
;
}
NSMutableDictionary
*
proxyToUse
=
[
NSMutableDictionary
dictionaryWithObjectsAndKeys
:[
self
proxyHost
],
hostKey
,[
NSNumber
numberWithInt
:[
self
proxyPort
]],
portKey
,
nil
];
CFReadStreamSetProperty
((
CFReadStreamRef
)[
self
readStream
],
kCFStreamPropertyHTTPProxy
,
proxyToUse
);
}
...
...
Classes/Tests/ProxyTests.h
View file @
16eceb3
...
...
@@ -21,6 +21,7 @@
-
(
void
)
testProxyAutodetect
;
-
(
void
)
testProxyWithSuppliedAuthenticationCredentials
;
-
(
void
)
testDoubleAuthentication
;
-
(
void
)
testProxyForHTTPS
;
@property
(
retain
)
ASINetworkQueue
*
queue
;
@property
(
assign
)
BOOL
complete
;
...
...
Classes/Tests/ProxyTests.m
View file @
16eceb3
...
...
@@ -18,6 +18,16 @@ static NSString *proxyPassword = @"";
@implementation
ProxyTests
-
(
void
)
testProxyForHTTPS
{
// Also test we are case-insensitive comparing our scheme
ASIHTTPRequest
*
request
=
[
ASIHTTPRequest
requestWithURL
:[
NSURL
URLWithString
:
@"HTTPS://selfsigned.allseeing-i.com/"
]];
[
request
setValidatesSecureCertificate
:
NO
];
[
request
startSynchronous
];
BOOL
success
=
([[
request
responseString
]
rangeOfString
:
@"All-Seeing Interactive"
].
location
!=
NSNotFound
);
GHAssertTrue
(
success
,
@"Failed to connect to an HTTPS URL using a proxy"
);
}
-
(
void
)
testAutoConfigureWithPAC
{
...
...
Please
register
or
login
to post a comment