Can't renew TLS certificates

Hi all,

The TLS certificate expired and didn’t autorenew on my MailInABox instance, when trying to do this manually using the Provision button via the admin interface I get an error of “something went wrong, sorry”.

I tried to run ‘curl -s https://mailinabox.email/setup.sh | sudo bash’ to see if that would fix the problem, I upgraded to v0.21b and got the error of

Updating system packages…
Installing system packages…
Initializing system random number generator…
Firewall is active and enabled on system startup
Installing nsd (DNS server)…
Installing Postfix (SMTP server)…
Installing Dovecot (IMAP server)…
Installing OpenDKIM/OpenDMARC…
Installing SpamAssassin…
Installing Nginx (web server)…
Installing Roundcube (webmail)…
Installing ownCloud (contacts/calendar)…
ownCloud is already latest version
Installing Z-Push (Exchange/ActiveSync server)…
Installing Mail-in-a-Box system management daemon…
Installing Munin (system monitoring)…
updated DNS: OpenDKIM configuration
Traceback (most recent call last):
File “management/ssl_certificates.py”, line 807, in
provision_certificates_cmdline()
File “management/ssl_certificates.py”, line 450, in provision_certificates_cmdline
status = provision_certificates(env, agree_to_tos_url=agree_to_tos_url, logger=my_logger, force_domains=force_domains, show_extended_problems=show_extended_problems)
File “management/ssl_certificates.py”, line 272, in provision_certificates
import acme.messages
File “/usr/local/lib/python3.4/dist-packages/acme/messages.py”, line 4, in
from acme import challenges
File “/usr/local/lib/python3.4/dist-packages/acme/challenges.py”, line 9, in
import OpenSSL
ImportError: No module named ‘OpenSSL’

After Googling a little I came across others having a similar issue which I resolved by -

sudo apt-get -y purge python3-openssl
sudo rm -rf /usr/local/lib/python3.4/dist-packages/{OpenSSL,cryptography}*
sudo pip3 install pyOpenSSL
sudo apt-get install python3-openssl

‘sudo mailinabox’ now runs correctly but says “No domains hosted on this box need a new TLS certificate at this time.” Even though I have 2 domains with expired certificates.

Upon using the admin interface to renew the certificates I still get the error of “something went wrong, sorry”.

If anyone could help I’d be massively thankful!

Ok I managed to resolve this myself.

When running sudo pip3 install pyOpenSSL I was getting -

Requirement already satisfied (use --upgrade to upgrade): pyOpenSSL in /usr/lib/python3/dist-packages

So I ran sudo pip3 install --upgrade pyOpenSSL which upgraded it.

After I done that running ./ssl_certificates.py successfully renewed my certificates.

All sorted! :slight_smile: