0
0
mirror of https://github.com/OpenVPN/openvpn3.git synced 2024-09-20 12:12:15 +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:
James Yonan 2012-04-18 12:13:29 +00:00
parent f8f2cb5a81
commit abbe662dcb
3 changed files with 31 additions and 12 deletions

View File

@ -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"))
throw option_error("remote-cert-tls not supported");
if (opt.get_ptr("remote-cert-ku"))

View File

@ -37,16 +37,31 @@ namespace openvpn {
RemoteList(const OptionList& opt)
{
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);
e.transport_protocol = Protocol::parse(o.get(3));
list.push_back(e);
}
Protocol default_proto(Protocol::UDPv4);
// parse "proto" option if present
{
const Option* o = opt.get_ptr("proto");
if (o)
default_proto = Protocol::parse(o->get(1));
}
// 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

View File

@ -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"))
throw option_error("remote-cert-tls not supported");
if (opt.get_ptr("remote-cert-ku"))