markshust / docker-magento

Mark Shust's Docker Configuration for Magento
https://m.academy/courses/set-up-magento-2-development-environment-docker/
MIT License
2.45k stars 981 forks source link

SSL For Multi Site Not #1172

Open epeetsTS opened 3 weeks ago

epeetsTS commented 3 weeks ago

Description When I run the command to setup SSL with more than one domain. Instead of generating SSLS for the requested domains, it tries to generate an SSL for a bad domain name made up of the requested domains.

Steps To Reproduce

  1. Run bin/setup-ssl <domain name> <domain name>

Expected Result Generated SSLs for each domain name.

Actual Result ERROR: " " is not a valid hostname, IP, URL or email

YevhenZvieriev commented 3 weeks ago

Hi, @epeetsTS

Thank you for reporting this issue. I have identified and resolved the problem with the setup-ssl script when generating SSL certificates for multiple domains in this PR.

I have updated the setup-ssl script to correctly handle multiple domains by iterating through each domain provided as an argument, generating individual SSL certificates. Here are the details of the changes:

You can now run the command as follows:

bin/setup-ssl <domain name> <domain name>

This will generate and install SSL certificates for your domains correctly.

Let me know if you encounter any further issues.

epeetsTS commented 3 weeks ago

@YevhenZvieriev Unfortunately, even though this does work to generate an ssl for each domain and eliminates the error, it causes another problem with creating an ssl for a SINGLE domain instead for the domains requested. The cert and key overwrite each other in the for loop and in the end you only have an SSL for the latest domain and not all of them.

Since this was working before. My solution was simply to revert back to an old commit for the bin/setup-ssl from 2023 (linked below) which works as expected generating a single ssl for multiple domains.

https://github.com/markshust/docker-magento/blob/2c8159ea517ccd64333d93971f92fd9e32787019/compose/bin/setup-ssl