mirror of
https://github.com/OpenVPN/openvpn3.git
synced 2024-09-20 20:13:05 +02:00
Android 4 client changes:
* Allow protocol to be specified by "proto" directive instead of requiring it to be present in "remote" directive. * Throw error if tls-remote is specified in client config file. Updated Android client.txt notes.
This commit is contained in:
parent
f8f2cb5a81
commit
abbe662dcb
@ -167,8 +167,10 @@ namespace openvpn {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// unsupported cert type checkers
|
// unsupported cert checkers
|
||||||
{
|
{
|
||||||
|
if (opt.get_ptr("tls-remote"))
|
||||||
|
throw option_error("tls-remote not supported");
|
||||||
if (opt.get_ptr("remote-cert-tls"))
|
if (opt.get_ptr("remote-cert-tls"))
|
||||||
throw option_error("remote-cert-tls not supported");
|
throw option_error("remote-cert-tls not supported");
|
||||||
if (opt.get_ptr("remote-cert-ku"))
|
if (opt.get_ptr("remote-cert-ku"))
|
||||||
|
@ -37,16 +37,31 @@ namespace openvpn {
|
|||||||
|
|
||||||
RemoteList(const OptionList& opt)
|
RemoteList(const OptionList& opt)
|
||||||
{
|
{
|
||||||
const OptionList::IndexList& rem = opt.get_index("remote");
|
Protocol default_proto(Protocol::UDPv4);
|
||||||
for (OptionList::IndexList::const_iterator i = rem.begin(); i != rem.end(); i++)
|
|
||||||
{
|
// parse "proto" option if present
|
||||||
Item e;
|
{
|
||||||
const Option& o = opt[*i];
|
const Option* o = opt.get_ptr("proto");
|
||||||
e.server_host = o.get(1);
|
if (o)
|
||||||
e.server_port = o.get(2);
|
default_proto = Protocol::parse(o->get(1));
|
||||||
e.transport_protocol = Protocol::parse(o.get(3));
|
}
|
||||||
list.push_back(e);
|
|
||||||
}
|
// cycle through remote entries
|
||||||
|
{
|
||||||
|
const OptionList::IndexList& rem = opt.get_index("remote");
|
||||||
|
for (OptionList::IndexList::const_iterator i = rem.begin(); i != rem.end(); i++)
|
||||||
|
{
|
||||||
|
Item e;
|
||||||
|
const Option& o = opt[*i];
|
||||||
|
e.server_host = o.get(1);
|
||||||
|
e.server_port = o.get(2);
|
||||||
|
if (o.size() >= 4)
|
||||||
|
e.transport_protocol = Protocol::parse(o.get(3));
|
||||||
|
else
|
||||||
|
e.transport_protocol = default_proto;
|
||||||
|
list.push_back(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// used to cycle through Item list
|
// used to cycle through Item list
|
||||||
|
@ -180,8 +180,10 @@ namespace openvpn {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// unsupported cert type checkers
|
// unsupported cert checkers
|
||||||
{
|
{
|
||||||
|
if (opt.get_ptr("tls-remote"))
|
||||||
|
throw option_error("tls-remote not supported");
|
||||||
if (opt.get_ptr("remote-cert-tls"))
|
if (opt.get_ptr("remote-cert-tls"))
|
||||||
throw option_error("remote-cert-tls not supported");
|
throw option_error("remote-cert-tls not supported");
|
||||||
if (opt.get_ptr("remote-cert-ku"))
|
if (opt.get_ptr("remote-cert-ku"))
|
||||||
|
Loading…
Reference in New Issue
Block a user