Skip to content
Search

Apache:Httpd:SSL

lastmod 2025-02-14created 2017-01-032 edits

When installing httpd, the OpenSSL module must be added. This is required to use the https security protocol.

How to generate an OpenSSL private key

  1. Go to the httpd root directory.
  2. Run /bin/openssl.exe.
  3. Check that the command line switches to OpenSSL>.
  4. Generate the private key to use for encryption.
    req -config ..\conf\openssl.cnf -new -out mydomain.csr
  5. Enter the private key password.
  6. Enter the country code.
    Country Name (2 letter code) [AU]:KO
  7. Enter the other information.
  8. Check that the following files are created.
    /bin/.rnd
    /bin/privkey.pem
    /bin/mydomain.csr
  9. Set up the public key that Apache will use.rsa -in privkey.pem -out mydomain.key
  10. Enter the private key password entered above again.
  11. Configure the certificate.
    req -config ..\conf\openssl.cnf -new -x509 -days 365 -key mydomain.key -out mydomain.crt
  12. Enter the country code.
    Country Name (2 letter code) [AU]:KO
  13. Enter the other information.
  14. Check that the following files are created.
    /bin/mydomain.crt, /bin/mydomain.key
  15. Done (exit).
    OpenSSL> exit

The other information above can be entered as below (it can also be left blank).

State or Province Name (full name) [Some-State]:
Locality Name (eg, city) []:
Organization Name (eg, company) [Internet Widgits Pty Ltd]:BLACKHOLE
Organizational Unit Name (eg, section) []:mydomain.com
Common Name (eg, YOUR name) []:mydomain.com
Email Address []:[email protected]

How to use OpenSSL

The following module must be loaded. (Default setting when installed together with OpenSSL)

LoadModule ssl_module modules/mod_ssl.so
<IfModule ssl_module>
SSLRandomSeed startup  builtin
SSLRandomSeed connect  builtin
</IfModule>

Add OpenSSL validation.

<IfModule ssl_module>
...
</IfModule>

Specify the HTTPS virtual host. (Default port 443)

NameVirtualHost *:443
<VirtualHost *:443>
...
</VirtualHost>

Turn on OpenSSL. (The OpenSSL security key must be used.)

SSLEngine on
SSLProtocol all
SSLCipherSuite HIGH:MEDIUM
SSLCertificateFile "conf/openssl/mydomain.crt"
SSLCertificateKeyFile "conf/openssl/mydomain.key"

See also

author Zer0 sitemap