# 获取 API key (一次性操作,key 长期有效)
curl -k "https://192.168.1.1/api/?type=keygen&user=admin&password=Paloalto1!"
# 运行后的输出: <response status = 'success'><result><key>LUFRPT1mSDlrN3N6SWdha1B0UjFOOEhRc3ZiczlqODQ9Y2NOdGxCM01PZEhRcFhZem94MXhzM2RwSVNQSEJkaFpVZ2t3VkdGTzJTVmMxelB4TmN0Q2VheUwxKzNzR0xETw==</key></result></response>
# 只需要记录 <key> 和 </key> 之间的部分即可
# 更新证书文件(支持更新已有证书)
curl -F "file=@/root/npm/certs/live/npm-1/cert.pem" "https://192.168.1.1/api/?key=LUFRPT1GeFhBWVJVM01PZEhRcFhZem94MXhzM2RwSVNJlcG5Uam5lVw==&type=import&category=certificate&certificate-name=halfco-dec&format=pem&passphrase=secretphrase" -k
# 更新证书对应的私钥(支持更新已有证书)
curl -F "file=@/root/npm/certs/live/npm-1/privkey.pem" "https://192.168.1.1/api/?key=LUFRPT1GeFhBWVJVc4MXhzM2RwSVNQSEJkaFpVZ2t3&type=import&category=private-key&certificate-name=halfco-dec&format=pem&passphrase=secretphrase" -k
# Commit
curl "https://192.168.1.1/api?type=commit&key=LUFRPT1GeFhm94MXhzM2RwSVNcG5Uam5lVw==&cmd=<commit></commit>" -k