views:

2934

answers:

1

If you try to pass the username/password to OpenVPN from a file via the --auth-user-pass switch, you get the following error:

"Sorry, 'Auth' password cannot be read from a file."

At least they're polite.

So our workaround was to programmatically write to "standard in" when we get the Auth Username: and Auth Password: prompts (this is in C#).

Something with the timing isn't 100% reliable, so I was looking for a way to pass the credentials to OpenVPN in a different way and came across this post: OpenVPN Post

It says you can recompile the source with a --enable-password-save option. Has anyone been able to do this?

My final question is: How can I pass an auth username/password to openvpn.exe on the client side? And does OpenVPNGUI somehow do this (maybe we can copy what they do)?

A: 

It turns out the problem wasn't with standard in.

I was using some locking where if the process exited in the middle of writing to standard in, there could be a deadlock.

There is no issue sending the password in this manner.

Jonathan.Peppers