NSURL StringwithContentsofURL

Hi, This seems to fail in XCode7 Beta but runs in XCode6, so wondering about network on iOS or on simulator, but no idea. Thanks, RobZ



/

NSMutableString *myEditPath = [NSMutableString stringWithFormat:@"http:/

NSURL *myURL = [NSURL URLWithString:myEditPath];

NSError *myError;

NSString *stringFromFile = [NSString stringWithContentsOfURL:myURL encoding:NSUTF8StringEncoding error:NULL];

NSLog(@"myEditPath = %@",myEditPath);

if (stringFromFile == nil) {

/

NSLog(@"Error reading file at %@\n%@",

myURL, [myError localizedFailureReason]);

}

Answered by junkpile in 11416022

Search these forums for App Transport Security. iOS 9 now silently translates HTTP URLs to HTTPS and enforces current best practice security levels (key sizes etc.) unless you opt out in your plist. Longer term, you should update your server to support SSL with good security. Short term you can add a plist key to get back to the old behaviour.

Source is on: https://github.com/robzim/Galileo-Viewer-iOS/tree/Development, anyone else seeing this?

Accepted Answer

Search these forums for App Transport Security. iOS 9 now silently translates HTTP URLs to HTTPS and enforces current best practice security levels (key sizes etc.) unless you opt out in your plist. Longer term, you should update your server to support SSL with good security. Short term you can add a plist key to get back to the old behaviour.

NSURL StringwithContentsofURL
 
 
Q