diff --git a/src/opnsense/mvc/app/controllers/OPNsense/OpenVPN/Api/ExportController.php b/src/opnsense/mvc/app/controllers/OPNsense/OpenVPN/Api/ExportController.php
index 0b2acdaab..153d6967d 100644
--- a/src/opnsense/mvc/app/controllers/OPNsense/OpenVPN/Api/ExportController.php
+++ b/src/opnsense/mvc/app/controllers/OPNsense/OpenVPN/Api/ExportController.php
@@ -380,6 +380,11 @@ class ExportController extends ApiControllerBase
// overlay (saved) user settings
if ($this->request->hasPost('openvpn_export')) {
$response = $this->storePresetsAction($vpnid);
+ // p12 password shouldn't be saved to the config, so we need to copy the content here as
+ // not defined in either model or configuration data.
+ if (!empty($this->request->getPost('openvpn_export')['p12_password'])) {
+ $config['p12_password'] = $this->request->getPost('openvpn_export')['p12_password'];
+ }
}
foreach ($this->getModel()->getServer($vpnid)->iterateItems() as $key => $value) {
if ($value !== "") {
diff --git a/src/opnsense/mvc/app/controllers/OPNsense/OpenVPN/forms/export_options.xml b/src/opnsense/mvc/app/controllers/OPNsense/OpenVPN/forms/export_options.xml
index 0e9800c39..2b85cebf0 100644
--- a/src/opnsense/mvc/app/controllers/OPNsense/OpenVPN/forms/export_options.xml
+++ b/src/opnsense/mvc/app/controllers/OPNsense/OpenVPN/forms/export_options.xml
@@ -31,6 +31,13 @@
checkboxUse a random local source port (lport) for traffic from the client. Without this set, two clients may not run concurrently.
+
+ openvpn_export.p12_password
+
+
+ password
+ Use a password to protect the pkcs12 file contents
+ openvpn_export.validate_server_cn
diff --git a/src/opnsense/mvc/app/views/OPNsense/OpenVPN/export.volt b/src/opnsense/mvc/app/views/OPNsense/OpenVPN/export.volt
index e78dd6e2f..1759317b7 100644
--- a/src/opnsense/mvc/app/views/OPNsense/OpenVPN/export.volt
+++ b/src/opnsense/mvc/app/views/OPNsense/OpenVPN/export.volt
@@ -24,6 +24,13 @@
# POSSIBILITY OF SUCH DAMAGE.
#}
+
+