Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option for ssl version #7

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ Role Variables
1. `stunnel_certificate_locality` (optional, if `stunnel_certificate_generation` is True, default locality) : self signed certificate locality field
1. `stunnel_certificate_file` certificate file to generate or use, depends on `stunnel_certificate_generation` value. Default is /tmp/certificate.pem
1. `stunnel_key_file` key file to generate or use, depends on `stunnel_certificate_generation` value. Default is /tmp/key.pem
1. To control SSL version :
1. `stunnel_sslversion` (optional): specify a SSL version
1. `stunnel_ssl_version_min` (optional): specify a min SSL version (when used with OpenSSL 1.1.0 and later)
1. `stunnel_ssl_version_max` (optional): specify a max SSL version (when used with OpenSSL 1.1.0 and later)
1. `stunnel_psks` a list of psk. This look like this:

- name: client1
Expand Down Expand Up @@ -65,6 +69,7 @@ Example Playbook
stunnel_certificate_locality: Paris
stunnel_certificate_file: /tmp/stunnel.pem
stunnel_key_file: /tmp/key.pem
stunnel_sslversion: TLSv1.2
stunnel_services:
- name: https
accept: 443
Expand Down
3 changes: 3 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ stunnel_certificate_state_name: state
stunnel_certificate_locality: locality
stunnel_certificate_file: /tmp/certificate.pem
stunnel_key_file: /tmp/key.pem
stunnel_sslversion: ""
stunnel_ssl_version_min: ""
stunnel_ssl_version_max: ""
stunnel_services: []
stunnel_psks: []
stunnel_pid: /var/run/stunnel.pid
Expand Down
10 changes: 10 additions & 0 deletions templates/stunnel.conf.j2
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
pid = {{ stunnel_pid }}
output = {{ stunnel_output }}

{% if stunnel_sslversion %}
sslVersion = {{ stunnel_sslversion }}
{% endif %}
{% if stunnel_ssl_version_min %}
sslVersionMin = {{ stunnel_ssl_version_min }}
{% endif %}
{% if stunnel_ssl_version_max %}
sslVersionMax = {{ stunnel_ssl_version_max }}
{% endif %}

{% if stunnel_use_certificate %}
cert = /etc/stunnel/stunnel.pem
{% endif -%}
Expand Down