1

I am trying to configure vpn programatically using NEVPNManager and i was successful upto saving the preferences , but i am getting error "negotiation with the VPN server failed" when i try to connect. Is there anything to do specific in protocolConfiguration to make it working??

Thanks in advance.

good4pc
  • 711
  • 4
  • 17

1 Answers1

0

Make sure your are setting the VPN config properly. Here is the sample code.

NEVPNProtocolIPSec *protocalConfigurationIPSec = [[NEVPNProtocolIPSec alloc] init]; protocalConfigurationIPSec.username = @"account";

        protocalConfigurationIPSec.passwordReference = passwordReference;
        protocalConfigurationIPSec.serverAddress = @"ipaddress";
        protocalConfigurationIPSec.authenticationMethod = NEVPNIKEAuthenticationMethodSharedSecret;
        protocalConfigurationIPSec.sharedSecretReference = sharedSecretReference;
        protocalConfigurationIPSec.localIdentifier = @"userGroup"];
        protocalConfigurationIPSec.remoteIdentifier = [serverDict objectForKey:@"userGroup";
        **protocalConfigurationIPSec.useExtendedAuthentication = YES;**
        protocalConfigurationIPSec.disconnectOnSleep = NO;
        manager.protocolConfiguration=protocalConfigurationIPSec;
        [manager setOnDemandEnabled:NO];
        [manager setLocalizedDescription:@"VPN"];
        manager.enabled = true;
murali
  • 1
  • 2