According to https://stackoverflow.com/a/13373392/5945317 , the NSURLConnectionDelegate method
- (void)connection:(NSURLConnection *)connection willSendRequestForAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge
identifies an SSL handshake.
Esp. regarding 3), I was surprised to see that it actually gets called again after about 2min, not as specified in other places (see link above) after 10mins.
Thanks guys!
After looking at the network layer and using simulator, i can report so much:
- is this method called reliably on every SSL handshake (ie no false negatives)
it is only called on full handshakes ( https://en.wikipedia.org/wiki/Transport_Layer_Security#TLS_handshake ), not resumed handshakes ( https://en.wikipedia.org/wiki/Transport_Layer_Security#Resumed_TLS_handshake )
- is this method only called during SSL handshake (ie no false positives)
empirically speaking, yes. Of course, i cannot guarantee it, but it seems very certain. The reason for it being called more often than expected was due to different endpoints (several IPs for the same domain, all starting its own TLS session).
I'm not sure what you mean by "only," but it is the NSURLConnectionDelegate
method that is called at that point
As Thomas noted, no.
No. It is called any time there is a authentication challenge. For example, for BasicAuth.
Note that NSURLSession
is strongly recommended in current code over NSURLConnection
. (I believe all of NSURLConnection
is now deprecated, though I haven't checked.)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.