Add information to generate SSL certificate

Change-Id: I24cb48c2c0da441885c0d688adfc502738c848cf
This commit is contained in:
Guillaume Thouvenin 2016-06-23 15:38:26 +02:00
parent 2b5dc4ccf7
commit 1e03ff5586
3 changed files with 155 additions and 0 deletions

69
fixtures/https/Readme.md Normal file
View File

@ -0,0 +1,69 @@
# Contents
- **rootCA.key** is the key used to self-signed rootCA.pem
- **rootCA.pem** is the certificate that will act as the **StackLight Root Authority**
The certificate has the following information:
```
Certificate:
Data:
Version: 3 (0x2)
Serial Number: 10160165599701850419 (0x8d0028c8355f5933)
Signature Algorithm: sha256WithRSAEncryption
Issuer: C=FR, ST=Rhone-Alpes, L=Grenoble, O=Mirantis, OU=StackLight, CN=StackLight Root Authority/emailAddress=mirantis@example.com
Validity
Not Before: Jun 23 14:43:30 2016 GMT
Not After : Oct 25 14:43:30 3015 GMT
Subject: C=FR, ST=Rhone-Alpes, L=Grenoble, O=Mirantis, OU=StackLight, CN=StackLight Root Authority/emailAddress=mirantis@example.com
Subject Public Key Info:
Public Key Algorithm: rsaEncryption
Public-Key: (4096 bit)
...
```
# Client settings
To be able to validate the certificate generated by the **StackLight Root
Authority** you need to download it into your web browser or pass it to
the client by using the correct option.
# Create a certificate
Follow these steps to generate a new certificate that can be used to enable
HTTPS for the StackLight plugins.
- Generate the key for the plugin _my-plugin_.
```
openssl genrsa -out my-plugin.key 2048
```
- Create the certificate signing request.
```
openssl req -new -key my-plugin.key -out my-plugin.csr
```
Here is an example on how to fill the fields for the Grafana plugin where
the choosen FQDN is _grafana.fuel.local_:
```
Country Name (2 letter code) [AU]:FR
State or Province Name (full name) [Some-State]:Rhone-Alpes
Locality Name (eg, city) []:Grenoble
Organization Name (eg, company) [Internet Widgits Pty Ltd]:Mirantis
Organizational Unit Name (eg, section) []:Fuel plugins
Common Name (e.g. server FQDN or YOUR name) []:grafana.fuel.local
Email Address []:mirantis@example.com
Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:
An optional company name []:
```
For _challenge password_ and _optional company_ just press enter.
- Sign it with the CA root key.
```
openssl x509 -req -in my-plugin.csr -CA rootCA.pem -CAkey rootCA.key -CAcreateserial -out my-plugin.crt -days 500 -sha256
```
- Concatenate the certificate and the private key into a single file.
```
cat my-plugin.crt my-plugin.key > my-plugin.pem
```

51
fixtures/https/rootCA.key Normal file
View File

@ -0,0 +1,51 @@
-----BEGIN RSA PRIVATE KEY-----
MIIJKgIBAAKCAgEA41Qj2+urFaScCLasLcbCi1w72E6mAeHqBfdV7Y4Fe5x+7uEx
JCXaxYUBmH1e0qi7jKqkKz1kVgNN5p8mR5GyGrPLAoYM/2fw9Z0Vguk2UuLhCNws
i9F88hnZWENkD+pgUBrc2HH2ZF5liSGjacSb268pCIQFBTVsx1oYdDKrJOxxUsmT
3waJGTfsgGeyZ3G2oywvnrEGgOKwcUeymmmGid0hhsKGYN4BD3TAUZnfr4dkjaNA
eGDc98YlYOsW+POdj32o8/5lX1XGQFoUZKaM18npHgXiKYiT93Yjn1v7ks1e4uOG
LkDQUJY+rVbFHVy1UUUv3Mzj1Dqc5raXXHgxN/AJU9h/oGB/4lzipKRP0as1AS7W
H6x1nEnXjRc6Xp66l7jmtlMkh63xBAEnyBcRabWjiDw4FTqJC5epN/b46n3XRpK6
VRrVSGNGHWAN1Eu6hO4bI0STthFc9Mx/Saa5CG4htC2QeyujYkmlInR7q/mfWJyz
frQMf5AI1SoLD4+BOKKia/VmOkYLgRDH2Z6fOFAtrXtp62rs+i21xxUHkVbCCsXh
KhcG/W8YFTH2jTzwi+JT+WxS4NxNk0kNge4moAeTCpKe5HnsWSiooYtE10Wbp7uk
rlrw8dT9ghEhnUzyrAR1gF+1ML5u3WGkUCRe1OUuUm+UpLyEEsrPi7qeh2ECAwEA
AQKCAgEAgCsyRI4s2XkDmE4V6YFEsnoAK8a8BhevcEmxIsyN/tGPJ3PD1xOYswB4
k9crnS4RABA9mztz1KLsSvi0Bmn4tuFjtjqKHX4m9vPn6vU98aGFKw+n9fTYs08r
oX3tbq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