Not secure or too many redirects on load of ssl site with trusted cert

I’ve imported my Local site from a zip containing files and db export from an ssl-enabled site. I’ve set the site to domain.local and enabled SSL using Apache. The overview has √ Trusted next to the domain.local.crt and I’ve verified status in Keychain. There it’s called domain.local and found under Certificates.

All browsers will claim site isn’t secure, also with making sure URL starts with https. For example Firefox will say that

"domain.local uses an invalid security certificate.

The certificate is not trusted because it is self-signed.

Error code: MOZILLA_PKIX_ERROR_SELF_SIGNED_CERT"

If I go ahead and load anyway there are too many redirects. I have deleted cookies and tried again to be sure, So the site is not really functioning locally for me. Online it’s up and running. The fail is on step 3 in the SSL Certificate on macOS document. I’m not sure why Local cannot do this on its own, because it’s not telling me what was tried and what failed. Yes, it says the info below, but I don’t know what I could do there. I tried deleting the site and the cert, then reimporting and trusting again. Still the same. I need some ideas on how to be able to load and operate the site locally. Of course, the site normally operates under another tld, so I’ll go and check source now, but it’s not mentioned this is needed.
From Logs:

“…[Note] Found ca.pem, server-cert.pem and server-key.pem in data directory. Trying to enable SSL support using them.”…"


System Details

  • Local Version: 9.2.8

  • Operating System (OS) and OS version: macOS 14.8 (ARM)


Local Logs

local-lightning-verbose.log (18.8 KB)


OK, after investigating source I removed the redirect code in .htaccess.

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTPS} !=on [NC]
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]
</IfModule>

This helped. I’d prefer if Local didn’t handle redirects for me as I got a plug-in handling this. Is there a way to disable this in Local settings? File edits would be OK.

Update:

as I should have expected as I didn’t change any settings, the SSL plugin later added back the rewrite code above that I removed to fix the all the redirects. The site however loads no problem also with this being back.
I’m not exactly sure then, why I got all those redirects at first and not now. With another backup later I might discover more.

It would be good to know how Local itself handles redirects though. Anyone know?

This topic was automatically closed 36 hours after the last reply. New replies are no longer allowed.