diff --git a/extras/ikev2setup.sh b/extras/ikev2setup.sh index bf6315b..f4b56e9 100755 --- a/extras/ikev2setup.sh +++ b/extras/ikev2setup.sh @@ -618,31 +618,8 @@ select_mobike() { fi } -select_p12_password() { -cat <<'EOF' - -Client configuration will be exported as .p12, .sswan and .mobileconfig files, -which contain the client certificate, private key and CA certificate. -To protect these files, this script can generate a random password for you, -which will be displayed when finished. - -EOF - - printf "Do you want to specify your own password instead? [y/N] " - read -r response - case $response in - [yY][eE][sS]|[yY]) - use_own_password=1 - echo - ;; - *) - use_own_password=0 - echo - ;; - esac -} - select_menu_option() { + echo echo "IKEv2 is already set up on this server." echo echo "Select an option:" @@ -661,6 +638,7 @@ select_menu_option() { confirm_setup_options() { cat </dev/null || exit 1 - if [ "$os_type" = "alpine" ]; 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" \ - -name "$client_name" -passin "pass:$p12_password" -passout "pass:$p12_password" || exit 1 - /bin/rm -f "$pem_file" - fi + pk12util -W "$p12_password" -d sql:/etc/ipsec.d -n "$client_name" -o "$p12_file" >/dev/null || exit 1 + if [ "$os_type" = "alpine" ]; 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" \ + -name "$client_name" -passin "pass:$p12_password" -passout "pass:$p12_password" || exit 1 + /bin/rm -f "$pem_file" fi if [ "$export_to_home_dir" = "1" ]; then @@ -1172,7 +1136,6 @@ EOF } print_client_revoked() { - echo echo "Certificate '$client_name' revoked!" } @@ -1223,16 +1186,11 @@ cat <