You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(oss): Update TLS example using openssl and including Subject Alternative Name (SAN)
- Example uses Subject Alternative Name extension required by modern clients.
- Updated example is more verbose, but should work cross-platform.
- Added troubleshooting steps.
- Passes tests.
- Reformatted to headings and remove list nesting.
If using a [certificate signed by a CA](#single-domain-certificates-signed-by-a-certificate-authority-ca), follow their instructions to download and install the certificate files.
64
-
Note the location where certificate files are installed, and then continue to [set certificate file permissions](#set-certificate-file-permissions).
67
+
### 1. Download or generate certificate files
65
68
66
-
{{% note %}}
67
-
#### Where are my certificates?
69
+
If using a [certificate signed by a CA](#single-domain-certificates-signed-by-a-certificate-authority-ca), follow their instructions to download and install the certificate files.
70
+
Note the location where certificate files are installed, and then continue to [set certificate file permissions](#set-certificate-file-permissions).
68
71
69
-
The location of your certificate files depends on your system, domain, and certificate authority.
72
+
{{% note %}}
73
+
#### Where are my certificates?
70
74
71
-
For example, if [Let's Encrypt](https://letsencrypt.org/) is your CA and you use [certbot](https://certbot.eff.org/) to install certificates, the default location is
72
-
`/etc/letsencrypt/live/$domain`. For more information about Let's Encrypt certificate paths, see [Where are my certificates?](https://eff-certbot.readthedocs.io/en/latest/using.html#where-are-my-certificates)
73
-
{{% /note %}}
75
+
The location of your certificate files depends on your system, domain, and certificate authority.
74
76
75
-
To generate [self-signed certificates](#self-signed-certificates), use the `openssl` command on your system.
77
+
For example, if [Let's Encrypt](https://letsencrypt.org/) is your CA and you use [certbot](https://certbot.eff.org/) to install certificates, the default location is
78
+
`/etc/letsencrypt/live/$domain`. For more information about Let's Encrypt certificate paths, see [Where are my certificates?](https://eff-certbot.readthedocs.io/en/latest/using.html#where-are-my-certificates)
79
+
{{% /note %}}
76
80
77
-
The following example shows how to generate certificates located in `/etc/ssl`.
78
-
Files remain valid for the specified `NUMBER_OF_DAYS`.
79
-
The `openssl` command prompts you for optional fields that you can fill out or leave blank; both actions generate valid certificate files.
81
+
To generate [self-signed certificates](#self-signed-certificates), use the `openssl` command on your system.
80
82
81
-
```bash
82
-
sudo openssl req -x509 -nodes -newkey rsa:2048 \
83
-
-keyout /etc/ssl/influxdb-selfsigned.key \
84
-
-out /etc/ssl/influxdb-selfsigned.crt \
85
-
-days <NUMBER_OF_DAYS>
86
-
```
83
+
The following example shows how to generate certificates located in `/etc/ssl`
84
+
on Unix-like systems and Windows.
85
+
_For example purposes only, the code creates an unencrypted private key._
87
86
88
-
1.**Set certificate file permissions**
89
-
<spanid="set-certificate-file-permissions"><span>
87
+
{{% warn %}}
88
+
#### Encrypt private keys
89
+
90
+
Use encrypted keys to enhance security.
91
+
If you must use an unencrypted key, ensure it's stored securely and has appropriate file permissions.
92
+
{{% /warn %}}
93
+
94
+
```bash
95
+
# Create a temporary configuration file that defines properties for
96
+
# the Subject Alternative Name (SAN) extension
97
+
cat > san.cnf <<EOF
98
+
[req]
99
+
distinguished_name = req_distinguished_name
100
+
req_extensions = v3_req
101
+
prompt = no
102
+
103
+
[req_distinguished_name]
104
+
C = US
105
+
ST = California
106
+
L = San Francisco
107
+
O = Example Company
108
+
OU = IT Department
109
+
CN = example.com
110
+
111
+
[v3_req]
112
+
keyUsage = keyEncipherment, dataEncipherment
113
+
extendedKeyUsage = serverAuth
114
+
subjectAltName = @alt_names
115
+
116
+
[alt_names]
117
+
DNS.1 = example.com
118
+
DNS.2 = www.example.com
119
+
EOF
120
+
121
+
# Generate a private key and certificate signing request (CSR)
0 commit comments