Via the next script you can create the needed OpenVPN configuration file for the client with using the OpenVPN APP on IOS/iPhone.
------------------------------------------------------------------------------------------------------------------------
export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
DATE=`date +%d-%m-%Y\ %H:%M`
MSDATE=`date +%Y-%m-%d\ %H:%M:00`
if [ -n "$1" ]
then
export CLIENT="$1"
if [ ! -f /etc/openvpn/${CLIENT}.crt ]
then
echo "You specified a non existing client name : $1"
echo "Exit..."
exit
fi
else
export CLIENT=Client1
fi
cd /root/
mkdir openvpn-profiles 2>/dev/null
WORKDIR=/root/openvpn-profiles
cd ${WORKDIR}
#
# Start from here with generating the needed profiles...
#
# 1st the general usage profile - Most used for smartphones
#
# IOS iPhone Client
#
export OVPN=${WORKDIR}/${CLIENT}.ovpn
> ${OVPN}
echo "client" >> ${OVPN}
echo "dev tun" >> ${OVPN}
echo "proto tcp" >> ${OVPN}
echo "remote <Your Domain/Servername> <Your configured portnumber>" >> ${OVPN}
echo "resolv-retry infinite" >> ${OVPN}
echo "nobind" >> ${OVPN}
echo "remote-cert-tls server" >> ${OVPN}
echo "cipher AES-256-CBC" >> ${OVPN}
echo "auth SHA512" >> ${OVPN}
echo "auth-nocache" >> ${OVPN}
echo "tls-version-min 1.2" >> ${OVPN}
echo "tls-cipher TLS-DHE-RSA-WITH-AES-256-GCM-SHA384:TLS-DHE-RSA-WITH-AES-256-CBC-SHA256:TLS-DHE-RSA-WITH-AES-128-GCM-SHA256:TLS-DHE-RSA-WITH-AES-128-CBC-SHA256" >> ${OVPN}
echo "persist-key" >> ${OVPN}
echo "persist-tun" >> ${OVPN}
echo "mute-replay-warnings" >> ${OVPN}
echo "verb 0" >> ${OVPN}
echo "set CLIENT_CERT 0" >> ${OVPN}
echo "<ca>" >> ${OVPN}
cat /etc/openvpn/ca.crt | grep -A 100 "BEGIN CERTIFICATE" | grep -B 100 "END CERTIFICATE" >> ${OVPN}
echo "</ca>" >> ${OVPN}
echo "<cert>" >> ${OVPN}
cat /etc/openvpn/${CLIENT}.crt | grep -A 100 "BEGIN CERTIFICATE" | grep -B 100 "END CERTIFICATE" >> ${OVPN}
echo "</cert>" >> ${OVPN}
echo "<key>" >> ${OVPN}
cat /etc/openvpn/${CLIENT}.key | grep -A 100 "BEGIN ENCRYPTED PRIVATE KEY" | grep -B 100 "END ENCRYPTED PRIVATE KEY" >> ${OVPN}
echo "</key>" >> ${OVPN}
echo "OpenVPN IOS ${CLIENT}" | mail -A ${OVPN} -s "OpenVPN IOS ${CLIENT} : Save this ovpn-file to for example Onedrive and open it on IOS via another application with OpenVPN" <Your E-mailaddress of the Client user>