Joe Patterson
2017-03-10 16:47:01 UTC
I'm pretty sure that the answer to this is probably "no", but I'm gonna ask
anyhow...
For clients connecting without auth-user-pass, I get a CLIENT notification
for ESTABLISHED, but none for DISCONNECT. Is there a way to make openvpn
send DISCONNECT messages on the management interface even if the client
didn't authenticate with a username/password?
The management app I'm writing is managing multiple openvpn instances and
it's fine for the ones that use username/password (because I get a CLIENT
notification for CONNECT, ESTABLISHED, DISCONNECT, and others), but when
it's managing one that doesn't use usernames/passwords, it only gets
ESTABLISHED and never knows when a client disconnects.
So far, the only solutions that I can think of are:
A) have a separate client-connect script that uses some sort of messaging
to inform my main app that something's disconnected. That seems really
ugly, but might work.
B) periodically poll for 'status' and note which clients aren't there
anymore. That means I have to balance how long I'm OK with stale clients
versus how often I poll status.
C) configure my password-less clients with a static username/password (via
the [up] file argument to --auth-user-pass) that I then ignore. This is
probably the best option, I just don't like it, and wanted to find out if
there was something simple I was overlooking. :)
Thanks!
-Joe
anyhow...
For clients connecting without auth-user-pass, I get a CLIENT notification
for ESTABLISHED, but none for DISCONNECT. Is there a way to make openvpn
send DISCONNECT messages on the management interface even if the client
didn't authenticate with a username/password?
The management app I'm writing is managing multiple openvpn instances and
it's fine for the ones that use username/password (because I get a CLIENT
notification for CONNECT, ESTABLISHED, DISCONNECT, and others), but when
it's managing one that doesn't use usernames/passwords, it only gets
ESTABLISHED and never knows when a client disconnects.
So far, the only solutions that I can think of are:
A) have a separate client-connect script that uses some sort of messaging
to inform my main app that something's disconnected. That seems really
ugly, but might work.
B) periodically poll for 'status' and note which clients aren't there
anymore. That means I have to balance how long I'm OK with stale clients
versus how often I poll status.
C) configure my password-less clients with a static username/password (via
the [up] file argument to --auth-user-pass) that I then ignore. This is
probably the best option, I just don't like it, and wanted to find out if
there was something simple I was overlooking. :)
Thanks!
-Joe