summaryrefslogtreecommitdiff
path: root/src/op_mode
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2022-04-26 19:13:59 +0200
committerGitHub <noreply@github.com>2022-04-26 19:13:59 +0200
commit7b72f6326ea64ab05e6884e36d1c8c6f9b76f64c (patch)
treeb520586782e7d87387af0fabe57e6c5442931d37 /src/op_mode
parent138c44783ae32926ebfed25faa839d109d9f9bac (diff)
parent59aa9c3f2e22bf3c38dcb4f2c61ca38e50385691 (diff)
downloadvyos-1x-7b72f6326ea64ab05e6884e36d1c8c6f9b76f64c.tar.gz
vyos-1x-7b72f6326ea64ab05e6884e36d1c8c6f9b76f64c.zip
Merge pull request #1301 from sever-sever/T4236
op-mode: T4236: Split to new lines openvpn client certs
Diffstat (limited to 'src/op_mode')
-rwxr-xr-xsrc/op_mode/generate_ovpn_client_file.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/op_mode/generate_ovpn_client_file.py b/src/op_mode/generate_ovpn_client_file.py
index 29db41e37..0628e6135 100755
--- a/src/op_mode/generate_ovpn_client_file.py
+++ b/src/op_mode/generate_ovpn_client_file.py
@@ -18,6 +18,7 @@ import argparse
import os
from jinja2 import Template
+from textwrap import fill
from vyos.configquery import ConfigTreeQuery
from vyos.ifconfig import Section
@@ -117,8 +118,11 @@ if __name__ == '__main__':
exit(f'OpenVPN certificate key "{key}" does not exist!')
ca = config.value(['pki', 'ca', ca, 'certificate'])
+ ca = fill(ca, width=64)
cert = config.value(['pki', 'certificate', cert, 'certificate'])
+ cert = fill(cert, width=64)
key = config.value(['pki', 'certificate', key, 'private', 'key'])
+ key = fill(key, width=64)
remote_host = config.value(base + [interface, 'local-host'])
ovpn_conf = config.get_config_dict(base + [interface], key_mangling=('-', '_'), get_first_key=True)