0

I used this guide to create VPN programmatically: http://ramezanpour.net/post/2014/08/03/configure-and-manage-vpn-connections-programmatically-in-ios-8/

 NEVPNProtocolIPSec *p = [[NEVPNProtocolIPSec alloc] init];
        p.username = [[alertView textFieldAtIndex:0] text];
        p.passwordReference = [keychainItemWrapper objectForKey:(__bridge id)kSecValueData];
        p.serverAddress = @"mylink.com";
        p.authenticationMethod = NEVPNIKEAuthenticationMethodSharedSecret;
        p.sharedSecretReference = [keychainItemWrapper objectForKey:(__bridge id)kSecAttrService];
        p.localIdentifier = @"identifier";
        p.remoteIdentifier = @"identifier";
        p.useExtendedAuthentication = YES;
        p.disconnectOnSleep = NO;


        [_vpnManager setProtocol:p];

Everything worked perfectly on iOS8. First I shown a UIAlertView with a textfield where user inputs it's username. Then it redirected me to settings where I entered shared Secret and then I could connect.

Now on iOS 9. After username input and pressing Done, I get a popup which says: "Application" Would Like to Add VPN Configurations. When I click Allow it saves the Profile. After that I go to settings and when I press to connect it says: No VPN shared secret was provided. (even if i retreive it from keychainItemWrapper as shown in my code.) Can anyone help me with this?

Thank You

rmaddy
  • 314,917
  • 42
  • 532
  • 579

1 Answers1

0

p.remoteIdentifier - this the name of your group, because you are using shared secret.

sacred0x01
  • 382
  • 2
  • 11