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

Can't connect on latest iOS/macOS #146

Closed vagifn closed 4 years ago

vagifn commented 4 years ago

Hi @ss-abramchuk

First of all would like to thank you for taking efforts to build this openvpn wrapper.

I used your latest framework v0.4.0 carefully according to instructions from readme file, however I'm experiencing "can't connect" results with error:

SIOCGIFMTU failed: Device not configured NEVirtualInterfaceAdjustReadBufferSize: interface_get_mtu failed (6), defaulting to max mtu

full console log screenshot: Screen-Shot-2019-11-30-at-9 53 23-PM

some details:

Could you give me a hint on how to overcome this issue?

PS: I also tried this tutorial (very much similar to yours) and no luck https://medium.com/better-programming/how-to-build-an-openvpn-client-on-ios-c8f927c11e80

ss-abramchuk commented 4 years ago

Hi @vagifn,

You may safely ignore SIOCGIFMTU failed: Device not configured. This error occurs after tunnel provider is shut down.

Getting back to your error, check not only localized description but error code and userInfo dictionary as well. Error code is an int value representing OpenVPNAdapterError enum and userInfo should contain error message.

vagifn commented 4 years ago

Checking these returned the following:

Error Domain=me.ss-abramchuk.openvpn-adapter.error-domain Code=70 
Dump userInfo: {
    NSLocalizedDescription = "Failed to establish connection with OpenVPN server";
    NSLocalizedFailureReason = "Unknown error.";
    "me.ss-abramchuk.openvpn-adapter.error-key.fatal" = 1;
    "me.ss-abramchuk.openvpn-adapter.error-key.message" = "Missing External PKI alias";
}
vagifn commented 4 years ago

resolved by setting OpenVPNConfiguration's .disableClientCert = true as recommended here now adapter is connecting correctly. @ss-abramchuk thanks for the hint!