Quantcast
Channel: OpenVPN Support Forum
Viewing all articles
Browse latest Browse all 265

The OpenVPN Access Server • Re: Block older client versions

$
0
0
I've circled back on this and am trying to do this with a post_auth script but I'm having trouble parsing the users client version

Here is the script that I'm using

Code:

from pyovpn.plugin import *from packaging.version import parse  # Import version parsing utilitydef post_auth(authcred, attributes, authret, info):    # get user's property list, or create it if absent    proplist = authret.setdefault('proplist', {})    # get ASCLI version, default to 0.0.0 if missing    uv_ascli_ver = proplist.get('UV_ASCLI_VER', '0.0.0')    # Compare UV_ASCLI_VER with 3.7.0    if parse(uv_ascli_ver) > parse(3.7.0):        authret['status'] = SUCCEED    else:        authret['status'] = FAIL  # Fail authentication        authret['reason'] = 'ASCLI version too low'        authret['client_reason'] = 'Client version is too old. Need to have greater than 3.7.0.  You have ${uv_ascli_ver}'    return authret

Statistics: Posted by dsekely_brs — Mon Feb 24, 2025 6:53 pm



Viewing all articles
Browse latest Browse all 265

Trending Articles