From 95c42faa4436c5dd761049a8a6e75996c815cc2c Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Fri, 20 Mar 2020 23:22:09 +0100 Subject: sstp: T2008: migrate SSL certificate nodes --- src/migration-scripts/sstp/0-to-1 | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/migration-scripts/sstp') diff --git a/src/migration-scripts/sstp/0-to-1 b/src/migration-scripts/sstp/0-to-1 index 2edf76a56..1d1bea51f 100755 --- a/src/migration-scripts/sstp/0-to-1 +++ b/src/migration-scripts/sstp/0-to-1 @@ -21,6 +21,7 @@ # - authentication radius-server x.x.x.x to authentication radius server x.x.x.x # - authentication radius-settings to authentication radius # - do not migrate radius server req-limit, use default of unlimited +# - migrate SSL certificate path import os import sys @@ -105,6 +106,22 @@ else: config.set_tag(new_base + ['authentication', 'radius', 'server']) config.delete(radius_server) + # migrate SSL certificates + old_ssl = new_base + ['sstp-settings', 'ssl-certs'] + new_ssl = new_base + ['ssl'] + config.copy(old_ssl, new_ssl) + config.delete(old_ssl) + + if config.exists(new_ssl + ['ca']): + config.rename(new_ssl + ['ca'], 'ca-cert-file') + + if config.exists(new_ssl + ['server-cert']): + config.rename(new_ssl + ['server-cert'], 'cert-file') + + if config.exists(new_ssl + ['server-key']): + config.rename(new_ssl + ['server-key'], 'key-file') + + try: with open(file_name, 'w') as f: f.write(config.to_string()) -- cgit v1.2.3