Skip to content

Commit 447780f

Browse files
author
Nick Brewer
committed
Updates to SSL Guides
1 parent 2fd78d3 commit 447780f

6 files changed

+158
-62
lines changed

docs/security/ssl/creating-a-selfsigned-certificate-centos-fedora.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ external_resources:
1515
- '[OpenSSL documentation](http://openssl.org/docs/)'
1616
---
1717

18-
This guide details the process for creating a self-signed SSL certificate, suitable for personal use or for applications used internally within an organization. The end product may be used with SSL-capable software such as web or email servers. We assume that you've followed the steps outlined in our [Getting Started guide](/docs/getting-started/), and that you're logged into your Linode as root via a shell session.
18+
This guide details the process for creating a self-signed SSL certificate, suitable for personal use or for applications used internally within an organization. We assume that you've followed the steps outlined in our [Getting Started guide](/docs/getting-started/), and that you're logged into your Linode as the root user. If you intend to use your SSL certificate on a website powered by Apache, you can continue to our [SSL Certificates with Apache on CentOS 7](/docs/security/ssl/ssl-apache2-centos) guide once you've completed the process outlined here.
19+
20+
For an SSL setup with the Nginx web server, please start with our [Nginx and SSL](/docs/security/ssl/provide-encrypted-resource-access-using-ssl-certificates-on-nginx) guide.
1921

2022
## Installing OpenSSL
2123

docs/security/ssl/creating-a-selfsigned-certificate-debian-ubuntu.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ external_resources:
1515
- '[OpenSSL documentation](http://openssl.org/docs/)'
1616
---
1717

18-
This guide details the process for creating a self-signed SSL certificate on Debian or Ubuntu. Self-signed certificates are suitable for personal use or for applications used internally within an organization. We assume that you've followed the steps outlined in our [Getting Started guide](/docs/getting-started/), and that you're logged into your Linode as root via a shell session.
18+
This guide details the process for creating a self-signed SSL certificate on Debian or Ubuntu. Self-signed certificates are suitable for personal use or for applications used internally within an organization. We assume that you've followed the steps outlined in our [Getting Started guide](/docs/getting-started/), and that you're logged into your Linode as the root user. If you intend to use your SSL certificate on a website powered by Apache, you can continue to our [SSL Certificates with Apache on Debian & Ubuntu](/docs/security/ssl/ssl-apache2-debian-ubuntu) guide once you've completed the process outlined here.
19+
20+
For an SSL setup with Nginx, please start with our [Nginx and SSL](/docs/security/ssl/provide-encrypted-resource-access-using-ssl-certificates-on-nginx) guide.
1921

2022
## Installing OpenSSL
2123

docs/security/ssl/obtaining-a-commercial-ssl-certificate-centos-fedora.md

Lines changed: 71 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,29 +21,39 @@ For an SSL setup with Nginx, please start with our [Nginx and SSL](/docs/securit
2121

2222
If you're hosting multiple websites with commercial SSL certificates on the same IP address, you'll need to use the [SNI](https://wiki.apache.org/httpd/NameBasedSSLVHostsWithSNI) extension of TLS. SNI is accepted by most modern web browsers, but if you expect to receive connections from clients running legacy browsers (Like Internet Explorer for Windows XP), you will need to [contact support](/docs/platform/support) to request an additional IP address.
2323

24-
{: .note}
25-
>
26-
>This guide assumes that you are logged in as the root user, and that you will not need to prepend commands with `sudo`.
24+
## Before You Begin
25+
26+
1. Complete our [Getting Started](/docs/getting-started) and [Securing Your Server](/docs/securing-your-server) guides.
2727

28-
## Install OpenSSL
2928

30-
Issue the following commands to install required packages for OpenSSL, the open source SSL toolkit.
29+
2. Ensure that your packages are up to date by running `yum upgrade`
3130

32-
yum update
33-
yum install openssl
31+
32+
3. Log in to your Linode as the root user, or escalate to root privileges.
3433

3534
## Create a Certificate Signing Request
3635

37-
Issue these commands to create a certificate signing request (CSR) for the site that will be using SSL. Be sure to change "example.com" to reflect the fully qualified domain name (subdomain.example.com) of the site you'll be using SSL with. Leave the challenge password blank. We entered 365 for the days parameter to the command, as we would be paying for one year of SSL certificate verification from a commercial certificate authority (CA).
36+
Issue these commands to create a certificate signing request (CSR) for the site that will be using SSL. Be sure to change "example.com" to reflect the fully qualified domain name (subdomain.example.com) of the site you'll be using SSL with. Leave the challenge password blank.
3837

3938
{: .note}
4039
>
41-
>While some CA providers will automatically include the "www" subdomain when issuing certificates for a root domain such as example.com, others do not. If you wish to secure multiple subdomains using the same certificate, you will need to create a [wildcard certificate](https://en.wikipedia.org/wiki/Wildcard_certificate) or make use of [subject alternative names](https://www.linode.com/docs/security/ssl/multiple-ssl-sites-using-subjectaltname).
40+
>While some CA providers will automatically include the "www" subdomain when issuing certificates for a root domain such as example.com, others do not. If you wish to secure multiple subdomains using the same certificate, you will need to create a [wildcard certificate](https://en.wikipedia.org/wiki/Wildcard_certificate).
41+
4242

4343
cd /etc/ssl/
4444
openssl req -new -newkey rsa:2048 -nodes -sha256 -days 365 -keyout /etc/pki/tls/private/example.com.key -out example.com.csr
4545

46-
Here are the values we entered for our example certificate. Note that you can ignore the extra attributes.
46+
The first command navigates to the `/etc/ssl` directory. The second command generates a secure key, as well as a certificate signing request. A brief explanation of the options used:
47+
48+
* `-nodes` instructs OpenSSL to create a certificate that does not require a passphrase. If this option is excluded, you will be required to enter the the passphrase in the console each time the application using it is restarted.
49+
50+
* `-days` determines the length of time in days that the certificate is being issued for. We entered 365 for the days parameter to the command, as we would be paying for one year of SSL certificate verification from a commercial certificate authority (CA).
51+
52+
* `rsa:` allows you to specify the size of the RSA key. In this case we've chosen 2048 bits as this is the recommended minimum size.
53+
54+
* `-sha256` ensures that the certificate request is generated using 265-bit SHA (Secure Hash Algorithm).
55+
56+
Here are the values we entered for our example certificate. Note that you can ignore the 'extra' attributes.
4757

4858
Generating a 2048 bit RSA private key
4959
......................................................++++++
@@ -93,4 +103,54 @@ The "ca-certificates" package comes with a bundle of root certs located under `/
93103
- [Globalsign](http://www.globalsign.com/en//)
94104
- [Comodo](https://support.comodo.com/index.php?_m=downloads&_a=view&parentcategoryid=1&pcid=0&nav=0)
95105

96-
Once you've downloaded your root certificate, you can add it to the `/etc/pki/tls/certs` directory. For example, if you were to download a root certificate for Verisign, you would save it to `/etc/pki/tls/certs/verisign.cer`.
106+
## Adding Your Root Certificate to the CA Bundle
107+
108+
You can add root certificates to the bundle by enabling dynamic CA configuration:
109+
110+
update-ca-trust force-enable
111+
112+
Next you'll need to copy the certificate file over to the appropriate directory, and then update the bundle:
113+
114+
cp root-example.crt /etc/pki/ca-trust/source/anchors/
115+
update-ca-trust extract
116+
117+
## Preparing a Chained SSL Certificate
118+
119+
In some cases, CAs have not submitted a Trusted Root CA Certificate to some or all browser vendors. Because of this, you can choose to *chain* roots for certificates to be trusted by web browsers. If you receive several files from your CA ending with `.crt`(collectively referred to as a `chained SSL certificate`), they must be linked into one file, in a specific order, to provide full support with most browsers. The following example uses a chained SSL certificate that was signed by Comodo. Enter the following command to prepare your chained SSL certificate:
120+
121+
cat example.com.crt COMODORSADomainValidationSecureServerCA.crt COMODORSAAddTrustCA.crt AddTrustExternalCARoot.crt > www.mydomain.com.crt
122+
123+
The contents of the resulting file will appear similar to the following (yours will be unique):
124+
125+
-----BEGIN CERTIFICATE-----
126+
MIIFSzCCBDOgAwIBAgIQVjCXC0bF9U8FypJOnL9cuDANBgkqhkiG9w0BAQsFADCB
127+
................................................................
128+
ncHG3hwHHwhiEz6ukC2mqxA+D3KILiywgHgWcumnpeCEUQgDzy0Fz2Ip/kR/1Fkv
129+
DCQzME2NkT1ZdW8fdz+Y
130+
-----END CERTIFICATE-----
131+
-----BEGIN CERTIFICATE-----
132+
MIIGCDCCA/CgAwIBAgIQKy5u6tl1NmwUim7bo3yMBzANBgkqhkiG9w0BAQwFADCB
133+
................................................................
134+
j4rBYKEMrltDR5FL1ZoXX/nUh8HCjLfn4g8wGTeGrODcQgPmlKidrv0PJFGUzpII
135+
-----END CERTIFICATE-----
136+
-----BEGIN CERTIFICATE-----
137+
ZFRydXN0IEV4dGVybmFsIFRUUCBOZXR3b3JrMSIwIAYDVQQDExlBZGRUcnVzdCBF
138+
................................................................
139+
Uspzgb8c8+a4bmYRBbMelC1/kZWSWfFMzqORcUx8Rww7Cxn2obFshj5cqsQugsv5
140+
-----END CERTIFICATE-----
141+
-----BEGIN CERTIFICATE-----
142+
MIIENjCCAx6gAwIBAgIBATANBgkqhkiG9w0BAQUFADBvMQswCQYDVQQGEwJTRTEU
143+
................................................................
144+
6wwCURQtjr0W4MHfRnXnJK3s9EK0hZNwEGe6nQY1ShjTK3rMUUKhemPR5ruhxSvC
145+
-----END CERTIFICATE-----
146+
147+
148+
The chart below breaks this down a bit more clearly:
149+
150+
{: .table .table-striped }
151+
| Certificate Type: | Issued to: | Issued by: |
152+
|----------------------------|:----------------------------------------|:----------------------------------------|
153+
| End-user Certificate | example.com | Comodo LLC |
154+
| Intermediate Certificate 1 | Comodo LLC | COMODORSADomainValidationSecureServerCA |
155+
| Intermediate Certificate 2 | COMODORSADomainValidationSecureServerCA | COMODORSAAddTrustCA |
156+
| Root certificate | COMODORSAAddTrustCA | AddTrustExternalCARoot |

docs/security/ssl/obtaining-a-commercial-ssl-certificate-debian-ubuntu.md

Lines changed: 67 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,29 +21,36 @@ For an SSL setup with Nginx, please start with our [Nginx and SSL](/docs/securit
2121

2222
If you're hosting multiple websites with commercial SSL certificates on the same IP address, you'll need to use the [SNI](https://wiki.apache.org/httpd/NameBasedSSLVHostsWithSNI) extension of TLS. SNI is accepted by most modern web browsers, but if you expect to receive connections from clients running legacy browsers (Like Internet Explorer for Windows XP), you will need to [contact support](/docs/platform/support) to request an additional IP address.
2323

24-
{: .note}
25-
>
26-
>This guide assumes that you are logged in as the root user, and that you will not need to prepend commands with `sudo`.
24+
## Before You Begin
2725

28-
## Install OpenSSL
26+
1. Complete our [Getting Started](/docs/getting-started) and [Securing Your Server](/docs/securing-your-server) guides.
2927

30-
Issue the following commands to install required packages for OpenSSL, the open source SSL toolkit.
28+
2. Ensure that your packages are up to date by running `apt-get update && apt-get upgrade`.
3129

32-
apt-get update && apt-get upgrade
33-
apt-get install openssl
30+
3. Log in to your Linode as the root user, or escalate to root privileges.
3431

3532
## Create a Certificate Signing Request
3633

37-
Issue these commands to create a certificate signing request (CSR) for the site that will be using SSL. Be sure to change "example.com" to reflect the fully qualified domain name (subdomain.example.com) of the site you'll be using SSL with. Leave the challenge password blank. We entered 365 for the days parameter to the command, as we would be paying for one year of SSL certificate verification from a commercial certificate authority (CA).
34+
Issue these commands to create a certificate signing request (CSR) for the site that will be using SSL. Be sure to change "example.com" to reflect the fully qualified domain name (subdomain.example.com) of the site you'll be using SSL with. Leave the challenge password blank.
3835

3936
{: .note}
4037
>
41-
>While some CA providers will automatically include the "www" subdomain when issuing certificates for a root domain such as example.com, others do not. If you wish to secure multiple subdomains using the same certificate, you will need to create a [wildcard certificate](https://en.wikipedia.org/wiki/Wildcard_certificate) or make use of [subject alternative names](https://www.linode.com/docs/security/ssl/multiple-ssl-sites-using-subjectaltname).
38+
>While some CA providers will automatically include the "www" subdomain when issuing certificates for a root domain such as example.com, others do not. If you wish to secure multiple subdomains using the same certificate, you will need to create a [wildcard certificate](https://en.wikipedia.org/wiki/Wildcard_certificate).
4239
4340
cd /etc/ssl/
4441
openssl req -new -newkey rsa:2048 -nodes -sha256 -days 365 -keyout /etc/ssl/private/example.com.key -out example.com.csr
4542

46-
Here are the values we entered for our example certificate. Note that you can ignore the extra attributes.
43+
The first command navigates to the `/etc/ssl` directory. The second command generates a secure key, as well as a certificate signing request. A brief explanation of the options used:
44+
45+
* `-nodes` instructs OpenSSL to create a certificate that does not require a passphrase. If this option is excluded, you will be required to enter the the passphrase in the console each time the application using it is restarted.
46+
47+
* `-days` determines the length of time in days that the certificate is being issued for. We entered 365 for the days parameter to the command, as we would be paying for one year of SSL certificate verification from a commercial certificate authority (CA).
48+
49+
* `rsa:` allows you to specify the size of the RSA key. In this case we've chosen 2048 bits as this is the recommended minimum size.
50+
51+
* `-sha256` ensures that the certificate request is generated using 265-bit SHA (Secure Hash Algorithm).
52+
53+
Here are the values we entered for our example certificate. Note that you can ignore the 'extra' attributes.
4754

4855
Generating a 2048 bit RSA private key
4956
......................................................++++++
@@ -93,4 +100,53 @@ The "ca-certificates" package comes with a bundle of root certs located under `/
93100
- [Globalsign](http://www.globalsign.com/en//)
94101
- [Comodo](https://support.comodo.com/index.php?_m=downloads&_a=view&parentcategoryid=1&pcid=0&nav=0)
95102

96-
Once you've downloaded your root certificate, you can add it to the `/etc/ssl/certs` directory. For example, if you were to download a root certificate for Verisign, you would save it to `/etc/ssl/certs/verisign.cer`.
103+
## Adding Your Root Certificate to the CA Bundle
104+
105+
If your ca-certificates bundle does not include your certificate authority's root cert, you can add it manually by moving the file to the source directory:
106+
107+
cp root-example.crt /usr/local/share/ca-certificates/
108+
109+
Issue this command to update the bundle with your new root certificate:
110+
111+
update-ca-certificates
112+
113+
## Preparing a Chained SSL Certificate
114+
115+
In some cases, CAs have not submitted a Trusted Root CA Certificate to some or all browser vendors. Because of this, you can choose to *chain* roots for certificates to be trusted by web browsers. If you receive several files from your CA ending with `.crt`(collectively referred to as a `chained SSL certificate`), they must be linked into one file, in a specific order, to provide full support with most browsers. The following example uses a chained SSL certificate that was signed by Comodo. Enter the following command to prepare your chained SSL certificate:
116+
117+
cat example.com.crt COMODORSADomainValidationSecureServerCA.crt COMODORSAAddTrustCA.crt AddTrustExternalCARoot.crt > www.mydomain.com.crt
118+
119+
The contents of the resulting file will appear similar to the following (yours will be unique):
120+
121+
-----BEGIN CERTIFICATE-----
122+
MIIFSzCCBDOgAwIBAgIQVjCXC0bF9U8FypJOnL9cuDANBgkqhkiG9w0BAQsFADCB
123+
................................................................
124+
ncHG3hwHHwhiEz6ukC2mqxA+D3KILiywgHgWcumnpeCEUQgDzy0Fz2Ip/kR/1Fkv
125+
DCQzME2NkT1ZdW8fdz+Y
126+
-----END CERTIFICATE-----
127+
-----BEGIN CERTIFICATE-----
128+
MIIGCDCCA/CgAwIBAgIQKy5u6tl1NmwUim7bo3yMBzANBgkqhkiG9w0BAQwFADCB
129+
................................................................
130+
j4rBYKEMrltDR5FL1ZoXX/nUh8HCjLfn4g8wGTeGrODcQgPmlKidrv0PJFGUzpII
131+
-----END CERTIFICATE-----
132+
-----BEGIN CERTIFICATE-----
133+
ZFRydXN0IEV4dGVybmFsIFRUUCBOZXR3b3JrMSIwIAYDVQQDExlBZGRUcnVzdCBF
134+
................................................................
135+
Uspzgb8c8+a4bmYRBbMelC1/kZWSWfFMzqORcUx8Rww7Cxn2obFshj5cqsQugsv5
136+
-----END CERTIFICATE-----
137+
-----BEGIN CERTIFICATE-----
138+
MIIENjCCAx6gAwIBAgIBATANBgkqhkiG9w0BAQUFADBvMQswCQYDVQQGEwJTRTEU
139+
................................................................
140+
6wwCURQtjr0W4MHfRnXnJK3s9EK0hZNwEGe6nQY1ShjTK3rMUUKhemPR5ruhxSvC
141+
-----END CERTIFICATE-----
142+
143+
144+
The chart below breaks this down a bit more clearly:
145+
146+
{: .table .table-striped }
147+
| Certificate Type: | Issued to: | Issued by: |
148+
|----------------------------|:----------------------------------------|:----------------------------------------|
149+
| End-user Certificate | example.com | Comodo LLC |
150+
| Intermediate Certificate 1 | Comodo LLC | COMODORSADomainValidationSecureServerCA |
151+
| Intermediate Certificate 2 | COMODORSADomainValidationSecureServerCA | COMODORSAAddTrustCA |
152+
| Root certificate | COMODORSAAddTrustCA | AddTrustExternalCARoot |

0 commit comments

Comments
 (0)