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:
I have tow file
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
and I create app connect my server use NEVPNManager
here is vpn configuration Code:
Code Block 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
Here is my connection processvpnclient.p12
I import ikev2vpnca.cer as iOS profiles manual
then start app connect vpn
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