DwarDoh
DwarDoh

Reputation: 572

Enable HTTPS wth ASIS3

I am using the Amazon S3 support library for ASIHttpRequest (ASIS3). It provides high level abstracted selectors for interacting with S3 repositories.

By default it is using URLs using standard HTTP, but I'd like to enable HTTPS.

Does anyone know how to do this?

Thanks!

Upvotes: 0

Views: 276

Answers (1)

DwarDoh
DwarDoh

Reputation: 572

There is a property in the base ASIS3Request class called requestScheme. It's default value is ASIS3RequestSchemeHTTP, change it to ASIS3RequestSchemeHTTPS and all S3 calls will use HTTPS.

Here is the initialization selector for ASIS3Request, changing requestScheme to use HTTPS.

- (id)initWithURL:(NSURL *)newURL
{
    self = [super initWithURL:newURL];
    // After a bit of experimentation/guesswork, this number seems to reduce the chance of a 'RequestTimeout' error
    [self setPersistentConnectionTimeoutSeconds:20];
    [self setRequestScheme:ASIS3RequestSchemeHTTPS];
    return self;
}

Upvotes: 1

Related Questions