Once I hit save button, webmin failed to restart with the following error in the log (/var/webmin/miniserv.error)
-----BEGIN ENCRYPTED PRIVATE KEY----- ... -----END ENCRYPTED PRIVATE KEY-----
It took me a little while to realise that webmin couldn't interpret the file due to ENCRYPTED bit indicating it isn't a PEM format. Solution: After googling how to convert private key to PEM format, I came up with this.
Failed to open SSL key /etc/webmin/miniserv.pem at /usr/libexec/webmin/miniserv.pl line 4332. Error: Webmin server did not write new PID file
Assuming restarting webmin will be all it takes but another problem occurred. Webmin relies on perl and particularly perl-Net-SSLeay module to read SSL encrypted files. However, my key has a passphrase which Webmin requires perl-PAM module to read. So bellow is the result of another google search.
mv /etc/webmin/miniserv.pem /etc/webmin/miniserv.pem.key openssl rsa -outform PEM -in /etc/webmin/miniserv.pem.key -out /etc/webmin/miniserv.pem
Once, that's done, webmin can be restarted without problem.
yum install perl-CPAN perl -MCPAN -e shell install Authen::PAM exit