1
votes

Does the iPhone librarby ASIHTTPRequest supports https protocol?

Thank you

3

3 Answers

4
votes

According to the comments for initWithURL:

// Should be an HTTP or HTTPS url, may include username and password if appropriate

So, yes, it should support HTTPS. Although I have not tried it.

3
votes

HTTPS is supported. I've been using these classes for HTTPS rather extensively lately.

1
votes

Yes actually, In that case you have to send password and username as shown in the below example.

NSURL *url = [NSURL URLWithString:@"http://allseeing-i.com/top_secret/"];
ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:url];
[request setUsername:@"username"];
[request setPassword:@"password"];

More information on the ASIHTTPRequest is found in the following URL :

http://allseeing-i.com/ASIHTTPRequest/How-to-use

EDIT : You can also try :

[request setValidatesSecureCertificate:NO]

Which works for self signed certificates.