Post

Replies

Boosts

Views

Activity

NEVPNManager connect to VPN server
I use https://github.com/hwdsl2/setup-ipsec-vpn as vpn server. and I create app connect my server use NEVPNManager here is vpn configuration Code:     func createNewConfiguration() {     let p = NEVPNProtocolIKEv2()           p.serverAddress = "xxxxx"     p.remoteIdentifier = "x"xxxx     p.localIdentifier = "vpnclient"        p.authenticationMethod = .certificate     p.identityData = try! Data(contentsOf: Bundle.main.url(forResource: "vpnclient", withExtension: "p12")!)     p.identityDataPassword = "password"                 p.useExtendedAuthentication = false     p.disconnectOnSleep = false           manager.isEnabled = true     manager.protocolConfiguration = p     manager.saveToPreferences { (error) in       guard error == nil else {         self.manager.protocolConfiguration = nil         return       }       self.connectAfterInit = true     }   } I have tow file ikev2vpnca.cer vpnclient.p12 Here is my connection process I import ikev2vpnca.cer as iOS profiles manual then start app connect vpn everything work fine. But when I delete ikev2vpnca.cer at Setting-General-Profile I can't connect to my VPN anymore Can I implement step 1 use swift code? I don't want to send ikev2vpnca.cer to my iPhone and manual install it There is no idea how to solve this problem
4
0
2.1k
Mar ’21