问题描述
使用使用 Nginx 作为 web 引擎的自定义设置和 cpanel 需要命令导出 ssl 文件以将其使用到 Nginx
cpanel 现在使用由 Comodo 提供支持的 AutoSSL,它免费提供,并且会在任何用户域 ssl 过期时自动更新
在easyApache4
通过这个命令
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:viewBindingIgnore="true"
tools:context=".ui.MainActivity">
结果
uapi --user=example SSL fetch_best_for_domain domain='example.com'
寻找在运行此命令后将 cab 、 crt 和 key 导出为文件的方法
在这个 url 上有使用 easyApache 3 的旧方法
解决方法
我有 11 个小时的搜索和查找时间
我构建了该脚本并与 nginx 配合使用
很高兴与您分享
RESULTS=$( uapi --user=example SSL fetch_best_for_domain domain='example.com' )
FIRST=`echo $RESULTS| awk -F \" '{print $2}'`
SECOND=`echo $RESULTS| awk -F \" '{print $4}'`
THIRD=`echo $RESULTS| awk -F \" '{print $6}'`
echo $FIRST | sed 's/\\n/\n/g' > /root/s.example.com.cab
echo $SECOND | sed 's/\\n/\n/g' > /root/s.example.com.crt
echo $THIRD | sed 's/\\n/\n/g' > /root/s.example.com.key
cat /root/s.example.com.crt /root/s.example.com.cab > /root/s.example.com.cert
rm -rf /root/s.example.com.cab /root/s.example.com.crt