RFE: download server configuration and allow population of servers using it

Created by: nmav

Description of the Issue

[This was long time in my todo list but never found the time to complete it so I open this bug to avoid getting it lost]

An openconnect/anyconnect server has the ability to send an XML configuration file listing all the available servers in that group. For example profile.xml can contain:

<?xml version="1.0" encoding="UTF-8"?>
<AnyConnectProfile xmlns="http://schemas.xmlsoap.org/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://schemas.xmlsoap.org/encoding/ AnyConnectProfile.xsd">
	<ServerList>
		<HostEntry>
	            <HostName>VPN Server in Germany</HostName>
	            <HostAddress>1.2.3.4</HostAddress>
		</HostEntry>
	</ServerList>
	<ServerList>
		<HostEntry>
	            <HostName>VPN Server in Czech Republic</HostName>
	            <HostAddress>3.4.5.6</HostAddress>
		</HostEntry>
	</ServerList>
</AnyConnectProfile>

Meaning two servers in two different locations. Clients like anyconnect or network manager will download this configuration and ask (or not) the user to populate its configuration based on that data. With libopenconnect one can download the xml config using openconnect_set_xmlsha1 and openconnect_write_new_config_vfn.

However, libopenconnect does not provide helper functions to populate this configuration. I've suggested some in the mailing list some time ago but they have not been merged.

It would be ideal for the openconnect gui client to utilize them internally even if they are not in libopenconnect, and help the user by automatically populating the configuration with the options that the server supports. That is relevant mostly for corporate environments where VPN servers are supported globally, or for VPN providers which very commonly do the same.

Edited by Nikos Mavrogiannopoulos