How do one go about handling individual client configurations in OpenVPN where the common name of the certificate includes non-UTF8 characters (Such as Swedish names)?
I had a look at the OpenVPN logs and it says:
10.0.0.6:33157 [l vberg] Peer Connection Initiated with [AF_INET]... l vberg/10.0.0.6:33157 MULTI_sva: pool returned IPv4... l vberg/10.0.0.6:33157 MULTI: Learn: ... l vberg/10.0.0.6:33157 SENT CONTROL [l vberg]: 'PUSH_REPLY...
So i dumped the "binary" representation of the log and this is what it actually says:
10.0.0.6:33157 [l\xef\xbf\xbd\xef\xbf\xbdvberg] Peer Connection Initiated with [AF_INET]...
Which translates to:
10.0.0.6:33157 [lövberg] Peer Connection Initiated with [AF_INET]...
Now, I thought of just naming the
/etc/openvpn/ccd/lovberg file to:
However none of which works. The easy solution here would obviously be to change the common name in the certificates and re-issue the certificate, but I would prefer to solve this without having to do so.
Is this possible?
Yes, I used Python and I copied the output of the log from
tail -f openvpn.log into Python in order to get the "binary" representation of the
OpenVPN 2.3.10 i386-openbsd5.9 (OpenSSL)
print([data])gives you a rather accurate description of the content without modifying it first. The only downside being the terminal encoding but usually none of the
with open('/var/log/openvpn/openvpn.log', 'rb') as fh: print([fh.read()])and that got me
öand renaming the client configuration to
/etc/openvpn/ccd/l\xc3\x83\xc2\xb6vbergworked. Write up a answer and the solution points are yours.