New Ticket     Tickets     Wiki     Browse Source     Timeline     Roadmap     Ticket Reports     Search

Ticket #21385 (new enhancement)

Opened 4 years ago

Last modified 2 years ago

apache2-2.2.13 Add a feature - auto generate SSL certificate file

Reported by: naoya.n@… Owned by: macports-tickets@…
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc:
Port: apache2

Description (last modified by jmr@…) (diff)

Hi, I added a feature to apache2 port. The feature is auto generate SSL certficate file(server.key & server.crt). I added post-destroot trigger.

    # Genarate SSL certificate file
    set openssl ${prefix}/bin/openssl
    if {![file exists ${confDir}/server.key]} {
        system "${openssl} genrsa -rand randomfile > ${confDir}/server.key"
    }

    if {![file exists ${confDir}/server.crt]} {
        set FQDN `/bin/hostname`
        system "
cat << EOF | ${openssl} req -new -key ${confDir}/server.key -x509 -days 365 -out ${confDir}/server.crt 2>/dev/null
--
SomeState
SomeCity
SomeOrganization
SomeOrganizationalUnit
${FQDN}
root@${FQDN}
EOF
"

Change History

comment:1 Changed 4 years ago by jmr@…

  • Description modified (diff)
  • Keywords apache2 removed
  • Version 1.8.0 deleted
  • Owner changed from macports-tickets@… to imajes@…
  • Type changed from request to enhancement
  • Port set to apache2

Please remember WikiFormatting.

comment:2 Changed 3 years ago by ryandesign@…

  • Owner changed from imajes@… to macports-tickets@…

James Cox (imajes) retires as MacPorts maintainer (see macports-mgr archives)

comment:3 Changed 2 years ago by mark@…

Has this been implemented? Having just done RedHat 6 installing mod_ssl which automatically installs a usable example key, and allows to to easily make a self-signed key and crt, I've seemingly jumped through hoops trying to (eventually) generate a usable key in MacPorts's openssl. The https://trac.macports.org/wiki/howto/MAMP helped when I eventually found it. But the 2.2.17 port still didn't have the automatic key generation shown in this ticket. Safari doesn't seem to want to know about the certificate, but FireFox treats it as I expected.

Note: See TracTickets for help on using tickets.