ddnsの設定確認
最近、ddnsの更新情報確認したら、8月末から更新できない状態が続いていた。
(スクリプトで使用しているwgetでhttps(SSL)接続ができていない。)
このサービスの掲示板を確認してみたら、認証局情報を更新すればよいらしい、ということが判明。
ということで、パッケージ「openssl」に含まれるファイル「ca-bundle.txt」の情報を更新。
以下のサイトを参考にしperlスクリプトでさくっと更新できた。
で、作った(というか、コピペした)スクリプトが以下のもの
#!/usr/bin/perl -w # # Used to regenerate ca-bundle.crt from the Mozilla certdata.txt. # Run as ./mkcabundle.pl > ca-bundle.crt # my $cvsroot = ':pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot'; my $certdata = 'mozilla/security/nss/lib/ckfw/builtins/certdata.txt'; open(IN, "cvs -d $cvsroot co -p $certdata|") || die "could not check out certdata.txt"; my $incert = 0; print<<EOH; # This is a bundle of X.509 certificates of public Certificate # Authorities. It was generated from the Mozilla root CA list. # # Source: $certdata # EOH while (<IN>) { if (/^CKA_VALUE MULTILINE_OCTAL/) { $incert = 1; open(OUT, "|openssl x509 -text -inform DER -fingerprint") || die "could not pipe to openssl x509"; } elsif (/^END/ && $incert) { close(OUT); $incert = 0; print "\n\n"; } elsif ($incert) { my @bs = split(/\\/); foreach my $b (@bs) { chomp $b; printf(OUT "%c", oct($b)) unless $b eq ''; } } elsif (/^CVS_ID.*Revision: ([^ ]*).*/) { print "# Generated from certdata.txt RCS revision $1\n#\n"; } }
で、実行。
# ./mkcabundle.pl > /usr/share/ssl/certs/ca-bundle.crt
その後、無事にスクリプト中のwgetも動き、どうにかDDNS情報の更新もできた。
書いてみるとたいしたことはやっていないけど、DNSそのものの設定ミスも含めるとかなりの時間を費やしてしまった…。