ss-abramchuk / OpenVPNAdapter

Objective-C wrapper for OpenVPN library. Compatible with iOS and macOS.
GNU Affero General Public License v3.0
482 stars 215 forks source link

When i called removeFromPreferences, get some error #221

Open angryAnt7 opened 3 years ago

angryAnt7 commented 3 years ago

SecItemDelete failed: -25300

public func configRemove() { self.providerManager.removeFromPreferences{ error in if let error = error { print("##configRemove (error)") } else { print("##configRemove (error)") } } }


VPN settings are cleared. I got error is nil. but i got this log SecItemDelete failed: -25300

I don`t use keychain my ovpn file already contains the certificate. here is my config code

let tunnelProtocol = NETunnelProviderProtocol() tunnelProtocol.username = "" tunnelProtocol.serverAddress = "" tunnelProtocol.providerBundleIdentifier = BundleId // bundle id of the network extension target tunnelProtocol.providerConfiguration = ["ovpn": data] tunnelProtocol.disconnectOnSleep = false self.providerManager.protocolConfiguration = tunnelProtocol self.providerManager.localizedDescription = "****" // the title of the VPN profile which will appear on Settings self.providerManager.isEnabled = true

There is no problem with the VPN-connection what should I do?