diff --git a/OpenVPN Adapter/OpenVPNConfiguration.mm b/OpenVPN Adapter/OpenVPNConfiguration.mm index adf8356..f742709 100644 --- a/OpenVPN Adapter/OpenVPNConfiguration.mm +++ b/OpenVPN Adapter/OpenVPNConfiguration.mm @@ -57,8 +57,7 @@ NSString *const OpenVPNTLSCertProfileDefaultValue = @"default"; OpenVPNTransportProtocolDefaultValue: @(OpenVPNTransportProtocolDefault) }; - NSString *currentValue = [value length] == 0 ? OpenVPNTransportProtocolDefaultValue : - [[value componentsSeparatedByString:@"-"] firstObject]; + NSString *currentValue = [value length] == 0 ? OpenVPNTransportProtocolDefaultValue :value; NSNumber *transportProtocol = options[currentValue]; NSAssert(transportProtocol != nil, @"Incorrect protocol value: %@", currentValue); diff --git a/OpenVPN Adapter/OpenVPNProperties.mm b/OpenVPN Adapter/OpenVPNProperties.mm index edf54a7..2dca5e5 100644 --- a/OpenVPN Adapter/OpenVPNProperties.mm +++ b/OpenVPN Adapter/OpenVPNProperties.mm @@ -40,7 +40,7 @@ using namespace openvpn; _remotePort = port; - NSString *currentProto = [NSString stringWithUTF8String:eval.remoteProto.c_str()]; + NSString *currentProto = [[[NSString stringWithUTF8String:eval.remoteProto.c_str()] componentsSeparatedByString:@"-"] firstObject]; _remoteProto = [OpenVPNConfiguration getTransportProtocolFromValue:currentProto]; _servers = nil;