Issuing a Free SSL Certificate and Scoring an A+ on Security! ~Apache Edition~
Overview
With the upcoming version upgrade of the Veritrans module,
an SSL certificate issued with SHA256 became mandatory.
When running the Veritrans module upgrade test in our test environment,
the need to install an SSL certificate arose.
While we couldn’t go so far as to install the same paid SSL as in production,
we needed to build something close to it, so we issued and installed a free SSL certificate.
I’ve summarized the above procedure below.
Environment
We are using AWS Marketplace: CentOS 6 (x86_64) - with Updates HVM.
- CentOS release 6.7 (Final)
- Apache 2.4.12
Procedure
Generating the CSR
As preparation, generate the CSR on the server where the SSL certificate will be installed.
Please refer to the following for how to generate a SHA256-compatible CSR.

Registering with StartCom
A verification code will be sent to the registered email address.
You’ll receive an email like this.
Enter the verification code to complete registration
SSL Issuance Procedure
Select the free version
Select the SSL for Web Server
Domain Validation
Enter the domain of the server where the SSL certificate will be installed
Verification by email
You need to make it possible to receive mail at the email address specified by StartSSL.
The following article was helpful for setting up mail reception on an EC2 instance. Thank you.
Receiving mail with postfix on AWS
One caveat regarding the article above:
runningyum updateright after creating the instance is fine,
but sometimes runningyum updateon AWS can cause a kernel panic.
Perhaps it was because I had reinstalled Python from source instead of via yum, and did various other things…I haven’t been able to fully track down the cause, but for instances that have been running for years, I’d like to refrain from running yum update.
When mail reception isn’t set up properly
Constantly tail /var/log/maillog to check the logs.
If you already have a receivable email address, change the destination with aliases.
postmaster@(domain) → root@(domain)If you get Permission denied in the mailbox and
can’t save received mail, forcibly change the mail directory as follows.
1 | /etc/postfix/main.cf |
Proceed to ordering the SSL certificate
Once verification by email is cleared, proceed to ordering the SSL certificate.
Creating the credentials
After entering the information, (domain).zip will be downloaded.
- Since the web server is Apache this time, we’ll refer to ApacheServer.
Upload the following two files inside ApacheServer in the extracted zip file to a directory of your choice.
- 1_root_bundle.crt
- 2_(domain).crt
This time, the upload destination directory will be the path where server.key and so on reside (/etc/httpd/conf/ssl.csr/).
Configuring ssl.conf
Installing an SSL certificate means
having Apache load it via the specified directives in its configuration file.
The main settings are as follows.
| Item | Value | Explain |
| ———————– | —————————————– |
| SSLCertificateChainFile | /etc/httpd/conf/ssl.csr/1_root_bundle.crt | Intermediate certificate |
| SSLCertificateFile | /etc/httpd/conf/ssl.csr/2_(domain).crt | SSL server certificate |
| SSLCertificateKeyFile | /etc/httpd/conf/ssl.csr/server.key | Private key paired with the SSL server certificate |
The following URL suggests the optimal configuration method based on each web server and openssl version.
https://ssl-config.mozilla.org/
/etc/httpd/conf.d/ssl.conf
1 | LoadModule ssl_module modules/mod_ssl.so |
No performance tuning has been done at all.
Please note that this is strictly about installing the SSL certificate.
Checking the syntax of the config file
1 | // Syntax check |
If a syntax error occurs, the relevant location will be displayed, so check it again.
However, just because there are no syntax errors doesn’t guarantee that no error will occur when Apache reloads,
so just in case, it’s a good idea to prepare a command that can immediately revert things.
For example,
renaming ssl.conf to ssl.conf.bk so that Apache won’t treat it as a configuration file.
Reloading the Apache config file
1 | # service httpd reload |
Accessing from a browser
I accessed it with Chrome.
- Detailed authentication information
Security check
You can run a diagnosis at the following site.
QUALYS SSL LABS
I got an “A”!
By the way,
if it’s a site where always using https communication is fine, configure it as follows
1 | <VirtualHost *:443> |
and I was able to get an “A+”!
Always-on https is secure, but it also depends on the site’s specifications, so it varies by situation.
That’s all.
