Skip to main content

openconnect-lite

Wrapper script for OpenConnect supporting Azure AD (SAMLv2) authentication to Cisco SSL-VPNs

Supported Platforms

  • Linux
  • macOS
  • Windows

Installation

  1. Install openconnect on your system
sudo apt install openconnect # Debian
brew install openconnect # macOS
scoop install main/openconnect # Windows
# For other platforms, see https://www.infradead.org/openconnect/download.html
  1. Install openconnect-lite

We use uv to install this project. If you don't have uv installed, you can install it by running:

curl -LsSf https://astral.sh/uv/install.sh | sh

Then, we can run following command to install openconnect-lite

uv tool install openconnect-lite

Usage

openconnect-lite --server <vpn_server_addr> --user <your_username>

Configuration

You can customize the behavior of openconnect-lite by creating a configuration file at $HOME/.config/openconnect-lite/config.toml on Unix and %LOCALAPPDATA%\.config\openconnect-lite\config.toml on Windows

on_disconnect = ""

[default_profile]
server = "<VPN_SERVER_ADDRESS>"
user_group = ""
name = ""

[credentials]
username = "<YOUR_USERNAME>"

[auto_fill_rules]
[[auto_fill_rules."https://*"]]
selector = "div[id=passwordError]"
action = "stop"

[[auto_fill_rules."https://*"]]
selector = "input[type=email]"
fill = "username"

[[auto_fill_rules."https://*"]]
selector = "input[name=Password]"
fill = "password"

[[auto_fill_rules."https://*"]]
selector = "input[data-report-event=Signin_Submit]"
action = "click"

[[auto_fill_rules."https://*"]]
selector = "#submitButton"
action = "click"

[[auto_fill_rules."https://*"]]
selector = "div[data-value=PhoneAppOTP]"
action = "click"

[[auto_fill_rules."https://*"]]
selector = "a[id=signInAnotherWay]"
action = "click"

[[auto_fill_rules."https://*"]]
selector = "input[name=otc]"
fill = "totp"

Adding custom openconnect arguments

Sometimes you need to add custom openconnect arguments. One situation can be if you get similar error messages:

Failed to read from SSL socket: The transmitted packet is too large (EMSGSIZE).
Failed to recv DPD request (-5)

or:

Detected MTU of 1370 bytes (was 1406)

Generally, you can add openconnect arguments after the -- separator. This is called "positional arguments". The solution of the previous errors is setting --base-mtu e.g.:

openconnect-lite --server vpn.server.com/group --user user@domain.com -- --base-mtu=1370

Development

This project uses uv for dependency management. To set up the development environment:

# Clone and set up the project
git clone https://github.com/kowyo/openconnect-lite
cd openconnect-lite

# Create the virtual environment and install all dependency groups
make dev
uv run openconnect-lite --help

Metadata

Release files for openconnect-lite 0.8.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for openconnect-lite 0.8.7
File Size Uploaded Provenance Actions
openconnect_lite-0.8.7.tar.gz 61.2 kB Without provenance Details for openconnect_lite-0.8.7.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for openconnect-lite 0.8.7
File Interpreter ABI Platform Actions
openconnect_lite-0.8.7-py3-none-any.whl Python 3 none any Details for openconnect_lite-0.8.7-py3-none-any.whl

Total release size: 90.5 kB

Release files / openconnect_lite-0.8.7.tar.gz

Download URL openconnect_lite-0.8.7.tar.gz
Size 61.2 kB
Tags Source
SHA-256 checksum
How to use checksums
4df9410ed96394d981a3a610d69d0e2b26090ca4aaeaa104a419981a30b9fff1
BLAKE2b-256 checksum
How to use checksums
b21ec986fae7d9561267676399dea98ac53cb8640befa3da7de97a479f48067a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.17 {"installer":{"name":"uv","version":"0.9.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / openconnect_lite-0.8.7-py3-none-any.whl

Download URL openconnect_lite-0.8.7-py3-none-any.whl
Size 29.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2764280df1b0c8e033dbb32419bf3b4fedb222fcb599e69b6ba2b505c3090f6b
BLAKE2b-256 checksum
How to use checksums
47e5c5a0d3ebfa53faf654a86e642bc4c9e759e7cdea19cff824e5869943f702
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.17 {"installer":{"name":"uv","version":"0.9.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for openconnect-lite 0.8.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.8.7 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page