Fix hardcoded env var values (#1283)
Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>
This commit is contained in:
parent
f1aa32d89c
commit
c03644524e
|
@ -1,5 +1,5 @@
|
||||||
CRT_LOCATION = certs
|
CRT_LOCATION = certs
|
||||||
KEY = default
|
THING_KEY = d7cc2964-a48b-4a6e-871a-08da28e7883d # example value
|
||||||
O = Mainflux
|
O = Mainflux
|
||||||
OU = mainflux
|
OU = mainflux
|
||||||
EA = info@mainflux.com
|
EA = info@mainflux.com
|
||||||
|
@ -11,7 +11,7 @@ all: clean_certs ca server_crt
|
||||||
# CA name and key is "ca".
|
# CA name and key is "ca".
|
||||||
ca:
|
ca:
|
||||||
openssl req -newkey rsa:2048 -x509 -nodes -sha512 -days 1095 \
|
openssl req -newkey rsa:2048 -x509 -nodes -sha512 -days 1095 \
|
||||||
-keyout $(CRT_LOCATION)/ca.key -out $(CRT_LOCATION)/ca.crt -subj "/CN=localhost/O=Mainflux/OU=IoT/emailAddress=info@mainflux.com"
|
-keyout $(CRT_LOCATION)/ca.key -out $(CRT_LOCATION)/ca.crt -subj "/CN=$(CN)/O=$(O)/OU=$(OU)/emailAddress=$(EA)"
|
||||||
|
|
||||||
# Server cert and key name is "mainflux-server".
|
# Server cert and key name is "mainflux-server".
|
||||||
server_cert:
|
server_cert:
|
||||||
|
@ -28,7 +28,7 @@ server_cert:
|
||||||
thing_cert:
|
thing_cert:
|
||||||
# Create mainflux server key and CSR.
|
# Create mainflux server key and CSR.
|
||||||
openssl req -new -sha256 -newkey rsa:4096 -nodes -keyout $(CRT_LOCATION)/$(CRT_FILE_NAME).key \
|
openssl req -new -sha256 -newkey rsa:4096 -nodes -keyout $(CRT_LOCATION)/$(CRT_FILE_NAME).key \
|
||||||
-out $(CRT_LOCATION)/$(CRT_FILE_NAME).csr -subj "/CN=$(KEY)/O=$(O)/OU=$(OU)/emailAddress=$(EA)"
|
-out $(CRT_LOCATION)/$(CRT_FILE_NAME).csr -subj "/CN=$(THING_KEY)/O=$(O)/OU=$(OU)/emailAddress=$(EA)"
|
||||||
|
|
||||||
# Sign client CSR.
|
# Sign client CSR.
|
||||||
openssl x509 -req -days 730 -in $(CRT_LOCATION)/$(CRT_FILE_NAME).csr -CA $(CRT_LOCATION)/ca.crt -CAkey $(CRT_LOCATION)/ca.key -CAcreateserial -out $(CRT_LOCATION)/$(CRT_FILE_NAME).crt
|
openssl x509 -req -days 730 -in $(CRT_LOCATION)/$(CRT_FILE_NAME).csr -CA $(CRT_LOCATION)/ca.crt -CAkey $(CRT_LOCATION)/ca.key -CAcreateserial -out $(CRT_LOCATION)/$(CRT_FILE_NAME).crt
|
||||||
|
|
Loading…
Reference in New Issue