Engine for secure and scalable VPN infrastructure https://ocserv.openconnect-vpn.net
Go to file
Nikos Mavrogiannopoulos d6b18598cd NEWS: updated [ci skip]
Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
2024-09-08 10:49:12 +02:00
build-aux build-aux: removed legacy gnulib files 2023-07-27 22:41:25 +02:00
doc README-oidc.md: mention that only the microsoft client supports OIDC [ci skip] 2024-06-03 21:11:07 +02:00
m4 Avoid Autoconf warning 2023-12-29 14:48:28 +01:00
src Update to increase pam stack size per https://gitlab.com/openconnect/ocserv/-/issues/619 2024-09-05 22:51:17 -04:00
tests Allow selecting group by URL or profile 2024-04-23 21:35:00 +02:00
.codespellrc Fix new typo found by codespell 2023-04-11 22:53:34 +02:00
.git-blame-ignore-revs Add .git-blame-ignore-revs 2022-11-28 11:25:00 +01:00
.gitignore release.sh: added script to do the release process 2023-07-27 22:39:37 +02:00
.gitlab-ci.yml .gitlab-ci.yml: use saas-linux-small-amd64 tag 2024-05-10 20:32:23 +02:00
.mailmap Merge my different identities in Git history 2023-11-26 12:49:11 +01:00
.triage-policies.yml .triage-policies.yml: updated 2024-01-16 06:12:32 +01:00
autogen.sh chmod +x autogen.sh 2021-12-22 19:17:58 +01:00
configure.ac released 1.3.0 2024-05-05 21:08:20 +02:00
CONTRIBUTING.md iFix a typo: directly → directory 2023-06-17 23:01:51 +02:00
COPYING Revert "license upgraded to GPLv3" 2014-09-24 11:34:15 +02:00
INSTALL Added options to explicitly disable checking for certain libraries 2014-02-24 19:13:05 +01:00
Makefile.am Switch from http-parser to llhttp 2024-04-28 13:37:19 +02:00
NEWS NEWS: updated [ci skip] 2024-09-08 10:49:12 +02:00
README.md Use apt-get instead of yum on Debian/Ubuntu 2024-08-22 12:04:04 +03:00
release.sh release.sh: use package type for tarball 2024-01-24 10:26:35 +01:00

About

The OpenConnect VPN server (ocserv) is an open source Linux SSL VPN server designed for organizations that require a remote access VPN with enterprise user management and control. It follows the openconnect protocol and is the counterpart of the openconnect VPN client. It is also compatible with CISCO's AnyConnect SSL VPN.

The program consists of:

  1. ocserv, the main server application
  2. occtl, the server's control tool. A tool which allows one to query the server for information.
  3. ocpasswd, a tool to administer simple password files.

Supported platforms

The OpenConnect VPN server is designed and tested to work, with both IPv6 and IPv4, on Linux systems. It is, however, known to work on FreeBSD, OpenBSD and other BSD derived systems.

Known limitation is that on platforms, which do not support procfs(5), changes to the configuration must only be made while ocserv(8) is stopped. Not doing so will cause new worker processes picking up the new configuration while ocserv-main will use the previous configuration.

Build dependencies

Debian/Ubuntu:

# Basic build tools
apt-get install -y build-essential pkg-config
# Required
apt-get install -y libgnutls28-dev libev-dev
# Optional functionality and testing
apt-get install -y libpam0g-dev liblz4-dev libseccomp-dev \
	libreadline-dev libnl-route-3-dev libkrb5-dev libradcli-dev \
	libcurl4-gnutls-dev libcjose-dev libjansson-dev liboath-dev \
	libprotobuf-c-dev libtalloc-dev libllhttp-dev protobuf-c-compiler \
	gperf iperf3 lcov libuid-wrapper libpam-wrapper libnss-wrapper \
	libsocket-wrapper gss-ntlmssp haproxy iputils-ping freeradius \
	gawk gnutls-bin iproute2 yajl-tools tcpdump
# For manpages
apt-get install -y ronn

Fedora/RHEL:

# Basic build tools
yum install -y install make automake gcc pkgconf-pkg-config
# Required
yum install -y gnutls-devel libev-devel
# Optional functionality and testing
yum install -y pam-devel lz4-devel libseccomp-devel readline-devel \
	libnl3-devel krb5-devel radcli-devel libcurl-devel cjose-devel \
	jansson-devel liboath-devel protobuf-c-devel libtalloc-devel \
	llhttp-devel protobuf-c gperf iperf3 lcov uid_wrapper \
	pam_wrapper nss_wrapper socket_wrapper gssntlmssp haproxy iputils \
	freeradius gawk gnutls-utils iproute yajl tcpdump
# For manpages
yum install -y rubygem-ronn-ng

See README-radius for more information on Radius dependencies and its configuration.

Build instructions

To build from a distributed release use:

$ ./configure && make && make check

To test the code coverage of the test suite use the following:

$ ./configure --enable-code-coverage
$ make && make check && make code-coverage-capture

Note that the code coverage reported does not currently include tests which are run within docker.

In addition to the prerequisites listed above, building from git requires the following packages: autoconf, automake, and xz.

To build from the git repository use:

$ autoreconf -fvi
$ ./configure && make

Basic installation instructions

Now you need to generate a certificate. E.g.

$ certtool --generate-privkey > ./test-key.pem
$ certtool --generate-self-signed --load-privkey test-key.pem --outfile test-cert.pem

(make sure you enable encryption or signing)

Create a dedicated user and group for the server unprivileged processes (e.g., 'ocserv'), and then edit the sample.config and set these users on run-as-user and run-as-group options. The run:

# cd doc && ../src/ocserv -f -c sample.config

Configuration

Several configuration instruction are available in the recipes repository.

Profiling

To identify the bottlenecks in software under certain loads you can profile ocserv using the following command.

# perf record -g ocserv

After the server is terminated, the output is placed in perf.data. You may examine the output using:

# perf report

Continuous Integration (CI)

We use the gitlab-ci continuous integration system. It is used to test most of the Linux systems (see .gitlab-ci.yml),and is split in two phases, build image creation and compilation/test. The build image creation is done at the openconnect/build-images subproject and uploads the image at the gitlab.com container registry. The compilation/test phase is on every commit to project.

How the VPN works

Please see the technical description page.

License

The license of ocserv is GPLv2+. See COPYING for the license terms.

Some individual code may be covered under other (compatible with GPLv2) licenses. For the CCAN components see src/ccan/licenses/ The inih library is under the simplified BSD license (src/inih/LICENSE.txt).