Used build-key-pass for existing client; how to clean up?

Need help configuring your VPN? Just post here and you'll get that help.

Moderators: TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech

Forum rules
Please use the [oconf] BB tag for openvpn Configurations. See viewtopic.php?f=30&t=21589 for an example.
Post Reply
User avatar
catkin
OpenVPN User
Posts: 25
Joined: Wed Aug 03, 2011 5:31 am

Used build-key-pass for existing client; how to clean up?

Post by catkin » Wed Aug 03, 2011 5:45 am

Hello :)

I accidentally used build-key-pass with the same client name as I had already created key and cert files for using build-key. Presumably because the client already existed, build-key-pass failed with "TXT_DB error number 2". Now the $KEY_DIR/<client name>.crt file is empty. Trying to clean up with revoke-full generates "error:0906D06C:PEM routines:PEM_read_bio:no start line:pem_lib.c:650:Expecting: TRUSTED CERTIFICATE" presumably because of the empty .crt file.

How to clean up?

The earlier client files should be available from backup.

EDIT: OpenVPN 2.1.3 running on Debian 6 Squeeze

Best

Charles

User avatar
Mimiko
Forum Team
Posts: 1564
Joined: Wed Sep 22, 2010 3:18 am

Re: Used build-key-pass for existing client; how to clean up

Post by Mimiko » Wed Aug 03, 2011 6:06 am

See
$KEY_DIR/index.txt
$KEY_DIR/serial
for glues. You'll figurea out what lines to delete.

User avatar
catkin
OpenVPN User
Posts: 25
Joined: Wed Aug 03, 2011 5:31 am

Re: Used build-key-pass for existing client; how to clean up

Post by catkin » Wed Aug 03, 2011 6:18 am

Thanks Mimiko :)

That was quick!

I deleted all the $KEY_DIR/<client name>.* files and the client's line from $KEY_DIR/index.txt after which build-key-pass was able to create files for the client name. :)

I couldn't see any use for $KEY_DIR/serial in this fix ... ?

Best

Charles
Server: OpenVPN 2.1.3 on Debian 6 Squeeze 64-bit

User avatar
Mimiko
Forum Team
Posts: 1564
Joined: Wed Sep 22, 2010 3:18 am

Re: Used build-key-pass for existing client; how to clean up

Post by Mimiko » Wed Aug 03, 2011 6:23 am

The $KEY_DIR/serial file stores next index to use.

User avatar
catkin
OpenVPN User
Posts: 25
Joined: Wed Aug 03, 2011 5:31 am

Re: Used build-key-pass for existing client; how to clean up

Post by catkin » Wed Aug 03, 2011 6:31 am

Mimiko wrote:The $KEY_DIR/serial file stores next index to use.
Thanks :)

If I hadn't created another client in the meantime, I could have set it back. Will there be any consequences from leaving it as-is?
Server: OpenVPN 2.1.3 on Debian 6 Squeeze 64-bit

User avatar
Mimiko
Forum Team
Posts: 1564
Joined: Wed Sep 22, 2010 3:18 am

Re: Used build-key-pass for existing client; how to clean up

Post by Mimiko » Wed Aug 03, 2011 6:44 am

This file is modified every time you create another client. So you may not worried about it content.

User avatar
catkin
OpenVPN User
Posts: 25
Joined: Wed Aug 03, 2011 5:31 am

Re: Used build-key-pass for existing client; how to clean up

Post by catkin » Wed Aug 03, 2011 7:01 am

Thanks Mimiko :) Problem solved; all good.
Server: OpenVPN 2.1.3 on Debian 6 Squeeze 64-bit

Post Reply