diff --git a/security/stunnel/Makefile b/security/stunnel/Makefile
index c79e12bfb..ed8d72bbb 100644
--- a/security/stunnel/Makefile
+++ b/security/stunnel/Makefile
@@ -1,5 +1,5 @@
PLUGIN_NAME= stunnel
-PLUGIN_VERSION= 1.0.1
+PLUGIN_VERSION= 1.0.2
PLUGIN_COMMENT= stunnel TLS proxy
PLUGIN_MAINTAINER= ad@opnsense.org
PLUGIN_DEPENDS= stunnel
diff --git a/security/stunnel/src/opnsense/mvc/app/controllers/OPNsense/Stunnel/forms/dialogService.xml b/security/stunnel/src/opnsense/mvc/app/controllers/OPNsense/Stunnel/forms/dialogService.xml
index 9d3230280..368810bf7 100644
--- a/security/stunnel/src/opnsense/mvc/app/controllers/OPNsense/Stunnel/forms/dialogService.xml
+++ b/security/stunnel/src/opnsense/mvc/app/controllers/OPNsense/Stunnel/forms/dialogService.xml
@@ -29,6 +29,12 @@
text
The port to forward traffic to.
+
+ service.protocol
+
+ dropdown
+ The application protocol to negotiate TLS.
+
service.servercert
diff --git a/security/stunnel/src/opnsense/mvc/app/models/OPNsense/Stunnel/Stunnel.xml b/security/stunnel/src/opnsense/mvc/app/models/OPNsense/Stunnel/Stunnel.xml
index 7c8fea715..4f5689ae8 100644
--- a/security/stunnel/src/opnsense/mvc/app/models/OPNsense/Stunnel/Stunnel.xml
+++ b/security/stunnel/src/opnsense/mvc/app/models/OPNsense/Stunnel/Stunnel.xml
@@ -1,6 +1,6 @@
//OPNsense/Stunnel
- 1.0.1
+ 1.0.2
Stunnel TLS encryption proxy
@@ -45,6 +45,14 @@
port needs to be an integer value between 1 and 65535
Y
+
+
+ IMAP
+ POP3
+ SMTP
+
+ N
+
N
Y
diff --git a/security/stunnel/src/opnsense/service/templates/OPNsense/Stunnel/stunnel.conf b/security/stunnel/src/opnsense/service/templates/OPNsense/Stunnel/stunnel.conf
index 1179e6bf1..d9f28b339 100644
--- a/security/stunnel/src/opnsense/service/templates/OPNsense/Stunnel/stunnel.conf
+++ b/security/stunnel/src/opnsense/service/templates/OPNsense/Stunnel/stunnel.conf
@@ -19,6 +19,9 @@ logId = unique
[{{service['@uuid']}}]
accept = {% if service.accept_address %}{{service.accept_address}}:{% endif %}{{service.accept_port}}
connect = {% if service.connect_address.find(":") > -1 %}[{{service.connect_address}}]{% else %}{{service.connect_address}}{% endif %}:{{service.connect_port}}
+{% if service.protocol %}
+protocol = {{service.protocol}}
+{% endif %}
cert = /usr/local/etc/stunnel/certs/{{service['@uuid']}}.crt
{% if service.cacert|default('') != '' %}
CAfile = /usr/local/etc/stunnel/certs/{{service['@uuid']}}.ca