I am trying to launch openvpn process for client using python's os.system() giving client.ovpn file as argument. However I want to pass the ssl/tls parameters inside os.system() with the '--cert' and '--key' along with the ovpn file path. The problem is I am having my cert/key data held in a buffer inside my python code instead of filepath which we usually mention in ovpn file. So I do not want to provide the cert/key
as files in client.ovpn file. These two arguments I should pass as extra options to openvpn command.
Code: Select all
# SSL/TLS parms.
# See the server config file for more
# description. It's best to use
# a separate .crt/.key file pair
# for each client. A single ca
# file can be used for all clients.
ca /pathToCaFile/ca.crt
#cert /pathToCertFile/ms.crt
#key /pathToKeyFile/private.key
Code: Select all
os.system('openvpn --config '+ pathToOpenvpnOvpnFile +' --log '+ pathToOpenvpnLogFile)
Code: Select all
os.system('openvpn --config '+ pathToOpenvpnOvpnFile +' --cert ' + certBufferNotFile + '--key ' + keyBufferNotFile +'--log '+ pathToOpenvpnLogFile)
Please let me know your advice on this.
thanks in advance for your replies.