lftpのエラー出力
$ lftp -d -c " \
set -a; \
open YYYYYYYYYYYYYYYYYYY@ftp.XXXXXXXXXXXXXXXXXXXXXXXXX.jp; \
rm -r .; \
mirror --no-perms --reverse --delete --only-newer --verbose /path/to/XXXXXXXXXXXXXXXXXX.jp/ .; \
exit; \
";
(snip)
rm: Fatal error: Certificate verification: Not trusted (XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX)
mirror: Fatal error: Certificate verification: Not trusted (XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX)
1 error detected
問題のあるサーバのみ回避
$ lftp -d -c " \
set ssl:verify-certificate/XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX no; \
set -a; \
open YYYYYYYYYYYYYYYYYYY@ftp.XXXXXXXXXXXXXXXXXXXXXXXXX.jp; \
rm -r .; \
mirror --no-perms --reverse --delete --only-newer --verbose /path/to/XXXXXXXXXXXXXXXXXX.jp/ .; \
exit; \
";
(snip)
opensslで証明書を表示、保存
$ echo "quit;" | openssl s_client -showcerts -connect ftp.XXXXXXXXXXXXXXXXXXXXXXXXX.jp:21 -starttls ftp | openssl x509 > ~/.lftp/ca-path/ftp.XXXXXXXXXXXXXXXXXXXXXXXXX.jp.21.crt
depth=2 C = US, O = Internet Security Research Group, CN = ISRG Root X1
verify return:1
depth=1 C = US, O = Let's Encrypt, CN = R3
verify return:1
depth=0 CN = *.XXXXXXXXXXXXXXXXXXXXXXXXX.jp
verify return:1
220 Hello. XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.
DONE