Letsencrypt automatic renewal throws an error (undefined subroutine &webmin::request_letsencrypt_cert)

When a Letsencrypt SSL certificate is up for renewal and collectinfo.pl is run, the script throws an error. If there're no certificates up for renewal the script exists fine:

# cat /etc/webmin/virtual-server/domains/14604458534030 | grep letsencrypt_last=
letsencrypt_last=1468321618
# /etc/webmin/virtual-server/collectinfo.pl
# sed -i 's/letsencrypt_last=.*/letsencrypt_last=0000/g' /etc/webmin/virtual-server/domains/14604458534030
# /etc/webmin/virtual-server/collectinfo.pl
Undefined subroutine &webmin::request_letsencrypt_cert called at /usr/share/webmin/virtual-server/feature-ssl.pl line 1979.

This seemed to have solved the problem:

*** /usr/share/webmin/virtual-server/feature-ssl.pl.old 2016-07-22 14:04:25.395413321 +0200
--- /usr/share/webmin/virtual-server/feature-ssl.pl 2016-07-22 14:02:07.642850871 +0200
***************
*** 1968,1987 ****
--- 1968,1988 ----
  # Time to do it!
  my $phd = &public_html_dir($d);
  my ($ok, $cert, $key, $chain);
  my @dnames;
  if ($d->{'letsencrypt_dname'}) {
  @dnames = split(/\s+/, $d->{'letsencrypt_dname'});
  }
  else {
  @dnames = &get_hostnames_for_ssl($d);
  }
+ &foreign_require('webmin');
  if (&get_webmin_version() >= 1.782) {
  ($ok, $cert, $key, $chain) = &webmin::request_letsencrypt_cert(
  \@dnames, $phd, $d->{'emailto'});
  }
  else {
  ($ok, $cert, $key, $chain) = &webmin::request_letsencrypt_cert(
  $dnames[0], $phd);
  }
 
  my ($subject, $body);
Status: 
Active

Comments

Title: Letsencrypt automatic renewal throws an error (ndefined subroutine &webmin::request_letsencrypt_cert) » Letsencrypt automatic renewal throws an error (undefined subroutine &webmin::request_letsencrypt_cert)

Thanks - I will include this fix in the next Virtualmin release.