Update IKEv2 script

- Fix IKEv2 "password is incorrect" issue when using Ubuntu 21.10
  Fixes #1073. Ref: #1048.
- Note: Ubuntu 21.10 is NOT a supported OS for the VPN setup scripts.
  Please use e.g. Ubuntu 20.04 instead.
  Ref: https://github.com/hwdsl2/setup-ipsec-vpn#requirements
This commit is contained in:
hwdsl2 2022-01-02 21:52:47 -06:00
parent 1aae392e48
commit 3c22bbbeb6

View File

@ -703,7 +703,7 @@ export_p12_file() {
create_p12_password
p12_file="$export_dir$client_name.p12"
pk12util -W "$p12_password" -d sql:/etc/ipsec.d -n "$client_name" -o "$p12_file" >/dev/null || exit 1
if [ "$os_type" = "alpine" ]; then
if [ "$os_type" = "alpine" ] || { [ "$os_type" = "ubuntu" ] && [ "$os_ver" = "11" ]; }; then
pem_file="$export_dir$client_name.temp.pem"
openssl pkcs12 -in "$p12_file" -out "$pem_file" -passin "pass:$p12_password" -passout "pass:$p12_password" || exit 1
openssl pkcs12 -keypbe PBE-SHA1-3DES -certpbe PBE-SHA1-3DES -export -in "$pem_file" -out "$p12_file" \