Commit Graph

20 Commits (577d982b51670f7f68d6dad9d0bf08f8a01879ba)

Author SHA1 Message Date
Selva Nair 428ee29246 Add support for marking connections as persistent
Persistent connections have openvpn.exe daemon started
external to the GUI (e.g., by the automatic service).
This patch adds support for attaching to the management
i/f of such daemons from the GUI and control the connection.

The GUI never stops or starts the openvpn.exe process in this
case. Instead, connect and disconnect buttons signal the
management interface of a running openvpn.exe process to start
the tunnel by attaching to mgmt i/f and sending hold-release if
needed  or stop it and wait in management-hold state
(see DisconnectDaemon()).

When the GUI process exits, persistent connections are left in their
current state using DetachOpenVPN().

No connections are marked as persistent as yet. That is done
in a following commit.

Signed-off-by: Selva Nair <selva.nair@gmail.com>
2022-08-08 10:11:25 -04:00
Selva Nair b44e685ff8 Retry on management timeout instead of aborting
In  some cases the service may take a while to startup openvpn.exe,
causing connection to the management interface to timeout. This could
leave  behind the OpenVPN process if/when it eventually starts up.
(Trac 905, 1050).

As errors in starting up the OpenVPN daemon are independently
handled, its better to keep retrying the management interface connection
until aborted due to errors or by the user.

- On timeout, log a message on the status window and retry the
  management interface connection

- Eliminate the timed-out state that is no longer used

- Call StopOpenVPN() before abort so that OpenVPN daemon
  is not left running in case it starts up later.

- In the unlikely event that OpenManagement() fails, show an error

- User can abort by pressing disconnect

A "retrying.." message is logged on to the status window every
15 seconds.

See Trac: #905, #1050

Signed-off-by: Selva Nair <selva.nair@gmail.com>
2022-06-20 13:15:45 -04:00
Lev Stipakov e3b06efcd2 URL profile import: support for 2FA
When 2FA is enabled, server (such as AS)
replies with HTTP 401 and issues a challenge.

Use existing facilities to parse CRV message
and prompt user for a response, then call REST
method again with encoded response as HTTP auth password.

See https://github.com/OpenVPN/openvpn3/blob/master/doc/webauth.md#challengeresponse-authentication
for more information.

Signed-off-by: Lev Stipakov <lev@openvpn.net>
2021-08-23 12:07:18 -04:00
Lev Stipakov 9ded7996ab URL profile import: add profile import dialog
This is the first patch from series which implemets
importing profile from URL, currently implemented
by OpenVPN Access Server.

Move "Import from file" menu item under new "Import"
item. Add "Import from AS..." item under "Import", which
opens new profile import dialog.

Signed-off-by: Lev Stipakov <lev@openvpn.net>
2021-08-23 12:07:18 -04:00
Lev Stipakov bb00d95f86 Web-based extra authentication
This adds support for web-based extra authentication, which may be
used by OpenVPN Cloud. When enabled and client sends IV_SSO=openurl,
server pushes Info command OPEN_URL:<url>. The client opens that URL and
user authenticates.

Signed-off-by: Lev Stipakov <lev@openvpn.net>
2021-06-02 00:49:08 -04:00
Selva Nair c51fd4450d Support for 'setenv name var' using echo
- Implement connection specific env variables. These are merged
  with the process environment strings and passed to scripts.

- To set an env variable, use 'echo setenv name value' in the config
  or push from the server. This will set "OPENVPN_name=value" in
  the connections's env set. Note that "name" is mangled as
  "OPENVPN_name" to avoid servers overwriting sensitive variables
  such as PATH. Names are set in the order received and same name
  overwrites any previously set value.

- Environment variable names are allowed to contain only alpha numeric
  characters and underscore as in openvpn.exe. But, unlike openvpn.exe,
  invalid names are ignored, not sanitized.

v2 changes (Dec 16, 2017):

- If value is missing, the directive is interpreted as a delete command
  and the env var with matching name in the connection's env set is removed.

- Windows needs env block to be ordered:
  While merging connection specific env vars with process env block, order
  the entries 'alphabetically' (locale independent, case insensitive
  unicode ordinal order). In case of duplicates, the value in connection
  env set replaces the one in process env.

Signed-off-by: Selva Nair <selva.nair@gmail.com>
2018-04-23 22:05:05 +03:00
Selva Nair 105e022f7b Subscribe to bytecount message from management interface
Signed-off-by: Selva Nair <selva.nair@gmail.com>
2018-01-30 10:20:58 +02:00
Selva Nair 31896ce33b Add restart button to connection menus
- This works the same way as restart button in the status window
  but is more conveniently accessible from the tray menu.

Signed-off-by: Selva Nair <selva.nair@gmail.com>
2018-01-20 11:41:19 -05:00
Selva Nair d7b0fcbe5b Merge pull request #137 from selvanair/echo
Parse ECHO directives from openvpn

Acked-by: Gert Doering <gert@greenie.muc.de>
2017-03-16 10:22:05 -04:00
Selva Nair 778cc3d225 Add a system-wide option to disable the password save feature
- A new registry HKLM\Software\OpenVPN\disable_save_passwords
  (32 bit DWORD value) may be set to a non-zero value to
  disable password saving by users. Applies to both auth and
  private key passwords. Usernames are always saved.

Signed-off-by: Selva Nair <selva.nair@gmail.com>
2017-03-07 11:49:03 -05:00
Selva Nair d4090a8842 Parse ECHO directives from openvpn
Support the following echo commands

- "echo forget-passwords": delete passwords internally saved by the GUI
  but do not disable the password save feature. Useful when pushed
  from the server so that it gets processed after authentication. Also see
  management-notes.txt in openvpn docs.

- "echo save-passwords": enables private-key and auth-user-pass passwords
  to be saved. Will be effective at startup only if present in the config
  file. If pushed from the server, will get used for subsequent
  password prompts. Essentially this has the effect of presenting the password
  dialogs to the user with save-password checkbox selected. The user may still
  uncheck it during the dialog.

Note: echo commands are processed as and when they are received and in the order
received.

TODO: support for "echo setenv name var", "echo disable-save-passwords" etc..

Signed-off-by: Selva Nair <selva.nair@gmail.com>
2017-02-27 13:47:59 -05:00
Selva Nair be417bb38f Support pkcs11 token insertion request and pin input
Note: IDS_NFO_TOKEN_PASSWORD_CAPTION and IDS_NFO_TOKEN_PASSWORD_REQUEST
strings need translation.

TODO: support for selecting pkcs11-id from the GUI

Signed-off-by: Selva Nair <selva.nair@gmail.com>
2016-11-15 19:29:23 -05:00
Selva Nair 5880fdcd02 Save username and optionally passwords
- Username and, optionally, password as well as the private
  key passphrase are saved in config-specific registry keys
- All saved data are kept encrypted using DPAPI
- The passphrase dialog is skipped if a valid saved private
  key password is available. However, the user-auth dialog
  is always presented, prefilled with the saved username
  and password.

Note: A text string "Save password" is added to three dialogs
in all language resource files. Additional text with ids
IDS_MENU_CLEARPASS and IDS_NFO_DELETE_PASS are added to the
STRINGTABLE only in the English language resource file.
All these need translations.

Signed-off-by: Selva Nair <selva.nair@gmail.com>
2016-05-29 19:35:30 -04:00
Selva Nair 854d76ae31 Read errors from the service pipe and handle fatal ones
Asynchronously read Input on the service pipe which are mostly
errors reported by the service. Display the errors on the status log
window and to the log file if its not opened by openvpn.
If/when openvpn fails to start or exits with error, close
the connection without waiting for management socket timeout.

v2:
- rebase to master
- fix a bug in setting manage.connected state
- ensure management socket is closed and resources freed before thread exit

Signed-off-by: Selva Nair <selva.nair@gmail.com>
2016-05-08 18:07:31 -04:00
Erwin Bronkhorst 267569888a Changed typo in include guard. 2016-04-20 00:25:32 +02:00
Heiko Hund 9d918954d5 ask for HTTP proxy credentials on demand
* use "auto" parameter for --http-proxy option
 * pass proxy credentialsls via management interface
 * also closes #3223163
2011-03-24 17:54:53 +01:00
Heiko Hund 4bcebba60f use managment interface 2010-09-10 11:39:39 +02:00
Heiko Hund 7c4bea3f7e remove support for openvpn version < 2.0 2010-06-29 16:12:17 +02:00
Heiko Hund a6e6d88115 refactor option handling code 2010-04-09 06:18:58 +02:00
Heiko Hund fd9e4ae6db import of openvpn-gui-1.0.3.zip
git-svn-id: https://openvpn-gui.svn.sourceforge.net/svnroot/openvpn-gui/trunk@2 43a1345a-9c20-4331-951f-9845fc178312
2008-12-18 11:08:35 +00:00