Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenVPN certificate authorization with cn_username in 'email' format #1980

Merged
merged 2 commits into from Apr 14, 2024

Conversation

Alexey-I
Copy link

This patch addresses such a scenario when OpenVPN clients utilize the certificate-only authorization scheme. It works out-of-the box in case cn_username contains a 'plain' username that is identical to corresponding user name of default Hub user database. However, if cn_username is in user@domain.tld format, the whole cn_username string is compared to Hub user database entries and does not match as Hub usernames cannot contain @ sign.

Changes proposed in this pull request:

  • If cn_username contains @ sign, it is being split into user name and domain name which are being passed along as username and hubname, respectively.
  • If cn_username does not contain @ sign, username and hubname are set as usual.

This patch has been tested on an experimental installation and shows the desired behavior:

  • If cn_username is a bare name, user is being authenticated agains the default hub.
  • If cn_username has the 'domain' part and a Hub with corresponding name exists, user is being authenticated and connected to the corresponding Hub.
  • If cn_username has the 'domain' part and a Hub with corresponding name does not exist, error messages Virtual Hub "company.tld" that the client is trying to connect to does not exist on the server. and The specified Virtual Hub does not exist on the server. are being logged and user is disconnected.

Co-authored-by: Davide Beatrici <github@davidebeatrici.dev>
@chipitsine chipitsine merged commit 465df16 into SoftEtherVPN:master Apr 14, 2024
12 checks passed
@chipitsine
Copy link
Member

thank you for contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants