Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

sallay

macrumors newbie
Original poster
Mar 20, 2015
3
0
I'd like to use Swift to write native api to realize HTTPS. There are some third-party frameworks, like RestKit、AFNetworking, but they are written in Objective-C and there might be some problems in future if I use them. So I want to use Swift and native api to implement HTTPS. It is easy to realize HTTPS. Only use NSURL and NSURLSession. And some people provide libraries, like https://github.com/daltoniam/SwiftHTTP

But how to realize HTTPS? Do I need other classes, except NSURL and NSURLSession? Is there any demo or tutorial to refer to?

And how to handle certificate of HTTPS? Is there any recommendation for HTTPS implemetation on iOS? Thanks a lot.
 
Connecting Securely to a URL

"Connecting to a URL via TLS is trivial. When you create an NSURLRequest object to provide to the initWithRequest:delegate: method, specify https as the scheme of the URL instead of http. The connection uses TLS automatically with no additional configuration."
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.