security/stunnel: Add client mode option to services (#2166)

This commit is contained in:
Nicola Bonavita
2021-03-05 11:12:06 +01:00
committed by GitHub
parent e682ed1b4b
commit ca30bb9ab6
3 changed files with 14 additions and 1 deletions
@@ -60,6 +60,12 @@
Additions may need a restart of stunnel (when the certificate was already used).
]]></help>
</field>
<field>
<id>service.clientmode</id>
<label>Client mode</label>
<type>checkbox</type>
<help><![CDATA[Use client mode for this tunnel. Connect to an SSL server, do not act as an SSL server.]]></help>
</field>
<field>
<id>service.ciphers</id>
<label>Ciphers</label>
@@ -1,6 +1,6 @@
<model>
<mount>//OPNsense/Stunnel</mount>
<version>1.0.2</version>
<version>1.0.3</version>
<description>
Stunnel TLS encryption proxy
</description>
@@ -63,6 +63,10 @@
<default>0</default>
<Required>Y</Required>
</enableCRL>
<clientmode type="BooleanField">
<default>0</default>
<Required>Y</Required>
</clientmode>
<ciphers type="JsonKeyValueStoreField">
<default>TLS_AES_128_GCM_SHA256,TLS_AES_256_GCM_SHA384,TLS_CHACHA20_POLY1305_SHA256,ECDHE-ECDSA-AES128-GCM-SHA256,ECDHE-RSA-AES128-GCM-SHA256,ECDHE-ECDSA-AES256-GCM-SHA384,ECDHE-RSA-AES256-GCM-SHA384,ECDHE-ECDSA-CHACHA20-POLY1305,ECDHE-RSA-CHACHA20-POLY1305,DHE-RSA-AES128-GCM-SHA256,DHE-RSA-AES256-GCM-SHA384</default>
<Required>Y</Required>
@@ -31,6 +31,9 @@ verifyChain = yes
CRLpath = {% if helpers.empty('OPNsense.Stunnel.general.chroot') %}/var/run/stunnel{% endif %}/certs/
{% endif %}
{% endif %}
{% if service.clientmode|default('0') == '1' %}
client = yes
{% endif %}
{% set ciphers =[] %}
{% set ciphersuites =[] %}
{% for cipher in service.ciphers.split(',') %}