Does anybody faced with such problem?
When code run saveToPreferencesWithCompletionHandler
app restarts by itself without crash, no errors in console.
NEVPNManager *manager = [NEVPNManager sharedManager];
[manager loadFromPreferencesWithCompletionHandler:^(NSError * _Nullable error) {
if (error) {
#if DEBUG
NSLog(@"loadFromPreferencesWithCompletionHandler_error: %@", error.localizedDescription);
#endif
return;
}
NSString *serverURL = [self vpnServerURLWithCountryItem:countryItem];
NSData *passwordReference = [self persistentReferenceForSavedPassword:credentials.password
service:@"passwordReferenceIKeV2"
account:credentials.username];
[KeychainManager save:@"passwordReferenceIKeV2" data:passwordReference];
NEVPNProtocolIKEv2 *protocol = [[NEVPNProtocolIKEv2 alloc] init];
protocol.username = credentials.username;
protocol.passwordReference = passwordReference;
protocol.serverAddress = serverURL;
protocol.serverCertificateIssuerCommonName = @"letsencrypt";
protocol.authenticationMethod = NEVPNIKEAuthenticationMethodNone;
protocol.disconnectOnSleep = NO;
protocol.useExtendedAuthentication = YES;
protocol.IKESecurityAssociationParameters.encryptionAlgorithm = NEVPNIKEv2EncryptionAlgorithmAES256;
protocol.IKESecurityAssociationParameters.integrityAlgorithm = NEVPNIKEv2IntegrityAlgorithmSHA256;
protocol.IKESecurityAssociationParameters.diffieHellmanGroup = NEVPNIKEv2DiffieHellmanGroup14;
protocol.IKESecurityAssociationParameters.lifetimeMinutes = 1440;
protocol.childSecurityAssociationParameters.encryptionAlgorithm = NEVPNIKEv2EncryptionAlgorithmAES256;
protocol.childSecurityAssociationParameters.integrityAlgorithm = NEVPNIKEv2IntegrityAlgorithmSHA256;
protocol.childSecurityAssociationParameters.diffieHellmanGroup = NEVPNIKEv2DiffieHellmanGroup14;
protocol.childSecurityAssociationParameters.lifetimeMinutes = 1440;
protocol.remoteIdentifier = serverURL;
[manager setProtocolConfiguration:protocol];
[manager setLocalizedDescription:@"Tunnel Name"];
manager.enabled = YES;
[manager saveToPreferencesWithCompletionHandler:^(NSError * _Nullable saveError) {
if (saveError) {
#if DEBUG
NSLog(@"saveToPreferencesWithCompletionHandler: %@", saveError.localizedDescription);
#endif
return;
}
if (completionHandler) {
completionHandler(error);
}
}];
}];