diff options
author | Christian Poessinger <christian@poessinger.com> | 2022-04-26 19:13:59 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-26 19:13:59 +0200 |
commit | 7b72f6326ea64ab05e6884e36d1c8c6f9b76f64c (patch) | |
tree | b520586782e7d87387af0fabe57e6c5442931d37 /src | |
parent | 138c44783ae32926ebfed25faa839d109d9f9bac (diff) | |
parent | 59aa9c3f2e22bf3c38dcb4f2c61ca38e50385691 (diff) | |
download | vyos-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')
-rwxr-xr-x | src/op_mode/generate_ovpn_client_file.py | 4 |
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) |