Skip to content

Commit

Permalink
Use legacy OpenSSL Format for Apple Devices (#14718)
Browse files Browse the repository at this point in the history
* fix openssl

* Update openssl.yml

---------

Co-authored-by: Jack Ivanov <17044561+jackivanov@users.noreply.github.com>
  • Loading branch information
vvorlov and jackivanov committed May 10, 2024
1 parent 6ce6f5c commit 8c4ae50
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
16 changes: 16 additions & 0 deletions roles/strongswan/tasks/openssl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -155,10 +155,25 @@
format: OpenSSH
with_items: "{{ users }}"

- name: Get OpenSSL version
shell: |
set -o pipefail
{{ openssl_bin }} version |
cut -f 2 -d ' '
args:
executable: bash
register: ssl_version
run_once: true

- name: Set OpenSSL version fact
set_fact:
openssl_version: "{{ ssl_version.stdout }}"

- name: Build the client's p12
shell: >
umask 077;
{{ openssl_bin }} pkcs12
{{ (openssl_version is version('3', '>=')) | ternary('-legacy', '') }}
-in certs/{{ item }}.crt
-inkey private/{{ item }}.key
-export
Expand All @@ -175,6 +190,7 @@
shell: >
umask 077;
{{ openssl_bin }} pkcs12
{{ (openssl_version is version('3', '>=')) | ternary('-legacy', '') }}
-in certs/{{ item }}.crt
-inkey private/{{ item }}.key
-export
Expand Down
1 change: 1 addition & 0 deletions users.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
[{% for i in _configs_list.files %}
{% set config = lookup('file', i.path)|from_yaml %}
'{{ config.server }}'
'{{ config.IP_subject_alt_name }}'
{{ ',' if not loop.last else '' }}
{% endfor %}]
Expand Down

0 comments on commit 8c4ae50

Please sign in to comment.