Download
https://www.infradead.org/openconnect/download.html
Building OpenConnect
https://www.infradead.org/openconnect/building.html
Install vpnc-script
https://www.infradead.org/openconnect/vpnc-script.html
-
Download the latest OpenConnect tar file from below ftp location and extract it
ftp://ftp.infradead.org/pub/openconnect/ -
Run
./configure
command from within the extracted directory
Got below error
checking for functional NLS support... yes
checking for GNUTLS... no
checking for OPENSSL... no
checking for OpenSSL without pkg-config... no
configure: error: Could not build against OpenSSL
Reason: The OpenSSL library is usually already installed, but you have to install the header files.
So had to install same using below command
sudo apt-get install libssl-dev
Run ./configure
again
Got below error
checking for LIBXML2... no
configure: error: in `/home/raman/Downloads/openconnect-8.02':
configure: error: The pkg-config script could not be found or is too old. Make sure it
is in your PATH or set the PKG_CONFIG environment variable to the full
path to pkg-config.
Alternatively, you may set the environment variables LIBXML2_CFLAGS
and LIBXML2_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
To get pkg-config, see <http://pkg-config.freedesktop.org/>.
See `config.log' for more details
Same as last error, I had to install libxml2-dev
sudo apt-get install libxml2-dev
Run ./configure
again
This time command completes.
Next
sudo make
sudo make install //to install the library
On trying to connect to VPN using below command
sudo openconnect --protocol=gp vpn.company.com
Got below error
openconnect: /usr/lib/x86_64-linux-gnu/libopenconnect.so.5: version `OPENCONNECT_5_5' not found (required by openconnect)
Issue can be from one of the below links
dlenski/openconnect#130
dlenski/openconnect#56
Above issue solved using below
If the command ldd /usr/local/sbin/openconnect
shows libopenconnect.so.5 => not found
in the output
then use command sudo ldconfig
else use sudo apt autoremove
to solve the issue
Try connecting again
This time, got push notification on mobile for approval
But below error
/usr/share/vpnc-scripts/vpnc-script: not found
Followed below link to solve the vpnc-script issue
https://www.infradead.org/openconnect/vpnc-script.html
Next error
Set up UDP failed; using SSL instead
Connected as 10.5.201.132, using SSL, with ESP disabled
/bin/sh: 1: /usr/share/vpnc-scripts/vpnc-script: Permission denied
Script '/usr/share/vpnc-scripts/vpnc-script' returned error 126
Seems the script has to be executable
So make it executable using below command
sudo chmod +x /usr/share/vpnc-scripts/vpnc-script
Now try connecting again
and
Finally connected to VPN!
HIH!
raevilman
Thank you!