Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SSL deactivated for specific domain, but still trying to get one from Letsencrypt #1241

Closed
mjunghanns opened this issue Mar 4, 2024 · 2 comments
Assignees
Milestone

Comments

@mjunghanns
Copy link

mjunghanns commented Mar 4, 2024

Describe the bug
I ran into a problem with a specific domain.
Since this domain is not being actively used at the moment, I disabled the use of SSL in the domain's configuration. To my surprise, Froxlor was still trying to obtain a certificate from Letsencrypt. I was able to overcome this by re-enabling the use of SSL for that domain, then actively deactivate the option "Create SSL certificate (Let's Encrypt)" and then deactive the use of SSL altogether for this specific domain.

System information

  • Froxlor version: v2.1.6
  • Web server: apache2
  • DNS server: Bind
  • POP/IMAP server: Dovecot
  • SMTP server: postfix
  • FTP server: proftpd
  • OS/Version: Debian 12 Bookworm

To Reproduce
Steps to reproduce the behavior:
Prerequisite:
A specific domain has SSL enabled and "Create SSL certificate (Let's Encrypt)" enabled

  1. Go to 'Ressources'->'Domains', select 'Edit' on specific Domain
  2. Deactivate SSL for this domain by disabling 'Create SSL certificate (Let's Encrypt)'
  3. Scroll down to bottom, click "Save"

Despite SSL being disabled, the cronjob still tries to obtain a SSL certificate from Let's Encrypt every time it runs.

Expected behavior
Once SSL is deactivated, I would expect Froxlor to not trying to obtain a SSL certificate from Let's Encrypt. I would expect SSL to be disabled alltogether for the specific domain.

@d00p d00p self-assigned this Mar 4, 2024
@d00p d00p added this to the 2.2.x milestone Mar 4, 2024
@d00p
Copy link
Member

d00p commented Mar 4, 2024

Can you verify that the following patch resolves the issue?

diff --git a/lib/Froxlor/Api/Commands/Domains.php b/lib/Froxlor/Api/Commands/Domains.php
index 8559e6e5..ad0d4c55 100644
--- a/lib/Froxlor/Api/Commands/Domains.php
+++ b/lib/Froxlor/Api/Commands/Domains.php
@@ -1528,13 +1528,12 @@ class Domains extends ApiCommand implements ResourceEntity
                                // enabled ssl for the domain but no ssl ip/port is selected
                                Response::standardError('nosslippportgiven', '', true);
                        }
-                       if (Settings::Get('system.use_ssl') == "0" || empty($ssl_ipandports)) {
+                       if (Settings::Get('system.use_ssl') == "0" || empty($ssl_ipandports) || !$sslenabled) {
                                $ssl_redirect = 0;
                                $letsencrypt = 0;
                                $http2 = 0;
-                               // we need this for the json_encode
-                               // if ssl is disabled or no ssl-ip/port exists
-                               $ssl_ipandports[] = -1;
+                               // act like $remove_ssl_ipandport
+                               $ssl_ipandports = [];

                                // HSTS
                                $hsts_maxage = 0;

@mjunghanns
Copy link
Author

Hello Michael,
excellent! That did the trick! It is now working as expected. Thank you!

@d00p d00p closed this as completed in d8b86fc Mar 4, 2024
d00p added a commit that referenced this issue Mar 8, 2024
…nbled flag to false; fixes #1241

Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

No branches or pull requests

2 participants