Hello
I'm trying to make a IKEv2 connection from objective-c code.
Here is server details:
address: 176.9.2.35
remote identifier: cvpn.magora.team
password: 3f393b
username: zaher.zohbi@gmail.com
I don't have Shared Secret key. I should connect with username and password only.
So, i'm tried to connect with a differet authentification methods.
NEVPNIKEAuthenticationMethodSharedSecret - i had some hope with that
NEVPNIKEAuthenticationMethodNone - not working
But i can't connect. My config was saved but can't connect. Status NEVPNStatusDisconnected. With this credentials i can connect from my OS X and from iPod system setting but from code not. Here is my code
NEVPNProtocolIKEv2 *protocol = [[NEVPNProtocolIKEv2 alloc] init];
protocol.serverAddress = @"176.9.2.35";
protocol.remoteIdentifier = @"cvpn.magora.team";
protocol.username = @"zaher.zohbi@gmail.com";
NSString *pass = @"3f393b";
[self createKeychainValue:pass forIdentifier:@"VPN_PASSWORD"];
protocol.passwordReference = [self searchKeychainCopyMatching:@"VPN_PASSWORD"];
protocol.authenticationMethod = NEVPNIKEAuthenticationMethodNone;
protocol.useExtendedAuthentication = YES;
protocol.disconnectOnSleep = NO;
[manager setLocalizedDescription:@"MyVpnConnection"];
[manager setProtocolConfiguration:protocol];
[manager setEnabled:YES];
[manager saveToPreferencesWithCompletionHandler:^(NSError *error){
if (error) {
NSLog(@"Save Error: %@",error);
}else{
NSLog(@"Saved");
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
completeHandle(YES,@"Save config success");
});
}
}];I tried protocol NEVPNProtocolIPSec but it's not working too.