MOLAuthenticatingURLSession 2.4

MOLAuthenticatingURLSession 2.4

TestsTested
LangLanguage Obj-CObjective C
License Apache 2
ReleasedLast Release Feb 2018

Maintained by Russell Hancox, bur.



  • By
  • Google Macops

A wrapper around NSURLSession providing validation of server certificates and easy-to-use client certificate authentication.

Requires ARC. Tested on OS X 10.11+.

Usage

#import <MOLAuthenticatingURLSession/MOLAuthenticatingURLSession.h>

- (void)postToServer {
  MOLAuthenticatingURLSession *authURLSession = [[MOLAuthenticatingURLSession alloc] init];
  authURLSession.userAgent = @"MyUserAgent";
  authURLSession.refusesRedirects = YES;
  authURLSession.serverHostname = @"my-hostname.com";
  NSURLSession *session = authURLSession.session;
  // You can use the NSURLSession as you would normally..
}

If you'd like to print status/error information:

  authURLSession.loggingBlock = ^(NSString *line) {
    NSLog(@"%@", line);
  };

Installation

Install using CocoaPods.

pod 'MOLAuthenticatingURLSession'

You can also import the project manually but this isn't tested.

Documentation

Reference documentation is at CocoaDocs.org:

http://cocoadocs.org/docsets/MOLAuthenticatingURLSession

Contributing

Patches to this library are very much welcome. Please see the CONTRIBUTING file.