From: =?iso-8859-2?Q?Kosztyu_Andr=E1s?= Date: Tue, 23 Jun 2009 15:43:19 +0200 Message-ID: <009a01c9f408$9259bc80$b70d3580$@hu> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_009B_01C9F419.55E28C80" Content-Language: hu Subject: [Openvpn-devel] bug? wrong CN in client-disconnect with username-as-common-name List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: openvpn-devel@lists.sourceforge.net This is a multi-part message in MIME format. ------=_NextPart_000_009B_01C9F419.55E28C80 Content-Type: text/plain; charset="iso-8859-2" Content-Transfer-Encoding: 7bit Hi, A few days ago I've set up an openvpn server on my server with mysql backend based on auth-user-pass-verify, client-connect, client-disconnect. Both client-connect and client-disconnect works has a main purpuse of setting iptables rules for forwarding each connection to a public ip, taken from an ip_pool table. Also, each connection is registered in a table called active. When the client disconnects, it deletes from active, deletes the iptables rule and logs everything... The authentication and every record is indexed by the common name (which is the username, not the cert name, so username-as-common-name on ).. so if i add a row in the "active" table with client-connect and then look for it with client-disconnect, it is based on the common name. So, now about the problem: some of the time (about 1 every 5 disconnect) the $common_name variable shows the cert name and not the username, thus making it impossible to find in active table, leaving many false iptables rules and funny logs like: username 1245682814 80.99.12.202 79.172.201.189 10.0.0.2 CONNECT certname 1245685700 80.99.12.202 10.0.0.2 DISCONNECT Is this a bug or did i make a mistake? [asrael@...1230... openvpn]$ openvpn --version OpenVPN 2.1_rc18 x86_64-unknown-linux-gnu [SSL] [LZO2] [EPOLL] built on Jun 21 2009 [asrael@...1230... openvpn]$ uname -a Linux vpn1.xxx.hu 2.6.29.4-167.fc11.x86_64 #1 SMP Wed May 27 17:27:08 EDT 2009 x86_64 x86_64 x86_64 GNU/Linux Thank you, Andras Kosztyu ------=_NextPart_000_009B_01C9F419.55E28C80 Content-Type: text/html; charset="iso-8859-2" Content-Transfer-Encoding: quoted-printable

Hi,

A few days ago I’ve set up an openvpn server on = my server with mysql backend based on auth-user-pass-verify, client-connect, client-disconnect. Both client-connect and client-disconnect works has a ma= in purpuse of setting iptables rules for forwarding each connection to a public ip, taken from an ip_pool table. Also, each connection is registered in a t= able called active. When the client disconnects, it deletes from active, deletes= the iptables rule and logs everything...

The authentication and every record is indexed by the = common name (which is the username, not the cert name, so username-as-common-name on ).. so if i add a row in the „active” table with client-connect and then look for it with client-disconnect, it is based on = the common name.

So, now about the problem: some of the time (about 1 e= very 5 disconnect) the $common_name variable shows the cert name and not the usern= ame, thus making it impossible to find in active table, leaving many false iptab= les rules and funny logs like:

username=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 1245682814=A0= =A0=A0=A0=A0=A0=A0 80.99.12.202=A0=A0=A0=A0=A0 79.172.201.189=A0 =A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 10.0.0.2=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0 CONNECT

certname=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 1245685700= =A0=A0=A0=A0=A0=A0=A0 80.99.12.202=A0=A0=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 10.0.0.2=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0 DISCONNECT

 

Is this a bug or did i make a mistake?

 

[asrael@...1230... openvpn]$ openvpn --version

OpenVPN 2.1_rc18 x86_64-unknown-linux-gnu [SSL] [LZO2] [EPOLL] built on Jun 21 2009

[asrael@...1230... openvpn]$ uname -a

Linux vpn1.xxx.hu 2.6.29.4-167.fc11.x86_64 #1 SMP Wed = May 27 17:27:08 EDT 2009 x86_64 x86_64 x86_64 GNU/Linux

 

Thank you,

Andras Kosztyu

------=_NextPart_000_009B_01C9F419.55E28C80--