Add check to make sure there is a carriage return between certificate and bundle
If you add a SSL certificate to a domain name that requires a bundle and there is no carriage return after the certificate and just before the bundle it will not allow nginx to restart because of a bad end of line error.
Nginx Restart Error Message:
Restarting nginx: nginx: [emerg] SSL_CTX_use_certificate_chain_file("/var/www/static.example.com/ssl/static.example.com.crt") failed (SSL: error:0906D066:PEM routines:PEM_read_bio:bad end line error:140DC009:SSL routines:SSL_CTX_use_certificate_chain_file:PEM lib)
PHP 5.3 Warning (No sure if this is to helpful):
Unknown on line 0 128032 semi-random bytes loaded Generating RSA private key, 2048 bit long modulus ..............+++ ...+++ e is 65537 (0x10001) writing RSA key PHP Warning: filesize(): stat failed for /var/www/clients/client1/web2/ssl/static.example.com.crt in /usr/local/ispconfig/server/plugins-available/nginx_plugin.inc.php on line 171 PHP Stack trace: PHP 1. {main}() /usr/local/ispconfig/server/server.php:0 PHP 2. modules->processDatalog() /usr/local/ispconfig/server/server.php:162 PHP 3. modules->raiseTableHook() /usr/local/ispconfig/server/lib/classes/modules.inc.php:222 PHP 4. call_user_func() /usr/local/ispconfig/server/lib/classes/modules.inc.php:253 PHP 5. web_module->process() /usr/local/ispconfig/server/lib/classes/modules.inc.php:253 PHP 6. plugins->raiseEvent() /usr/local/ispconfig/server/mods-available/web_module.inc.php:114 PHP 7. call_user_func() /usr/local/ispconfig/server/lib/classes/plugins.inc.php:120 PHP 8. nginx_plugin->ssl() /usr/local/ispconfig/server/lib/classes/plugins.inc.php:120 PHP 9. filesize() /usr/local/ispconfig/server/plugins-available/nginx_plugin.inc.php:171
I think there need to be some extra checking going on if a bundle is added to the certificate and to double check that there is a carriage return after the certificate code and just before the beginning of the bundle code.