Last active
October 8, 2020 21:24
-
-
Save hoat23/f71d081d06c3667f61106784f0c4ea8e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Generate private key | |
openssl genrsa [-des3] -out CA.key 2048 | |
# Generate public key | |
openssl rsa -in CA.key -pubout -out CA.PUBLIC.key | |
# Generate a certificate | |
openssl req -new -x509 -days 1826 -key CA.key -out CA.crt | |
# Create a server key | |
openssl genrsa -out SERVER.key 2048 | |
# Create a certificate request | |
openssl req -new -key SERVER.key -out SERVER.csr | |
# Sign the certificate request | |
sudo openssl x509 -req -in SERVER.csr -CA CA.crt -CAkey CA.key -CAcreateserial -out SERVER.crt -days 360 | |
# Review | |
- CA.key -> CA.crt | |
- SERVER.key -> SERVER.csr -> SERVER.crt | |
# In broker just copy: | |
- CA.crt | |
- SERVER.key | |
- SERVER.crt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Create certificates by broker mqtt