2022-10-12 14:04:37 +00:00
|
|
|
# Create new TLS certs to NeoFS node
|
2021-06-10 13:25:02 +00:00
|
|
|
|
2022-08-23 14:11:03 +00:00
|
|
|
CURRENT_DIR=$(dir $(abspath $(lastword $(MAKEFILE_LIST))))
|
|
|
|
STORAGE_DIR=$(patsubst %/,%,$(CURRENT_DIR))
|
2022-10-27 09:53:27 +00:00
|
|
|
SSL_CONFIG:=$(shell mktemp)
|
2021-06-10 13:25:02 +00:00
|
|
|
|
|
|
|
get.storage:
|
2022-10-12 14:04:37 +00:00
|
|
|
@echo "⇒ Creating TLS certs to NeoFS node"
|
2021-06-10 13:25:02 +00:00
|
|
|
@(echo "[req]"; \
|
|
|
|
echo "distinguished_name=req"; \
|
|
|
|
echo "req_extensions=san"; \
|
|
|
|
echo "[san]"; \
|
|
|
|
echo "subjectAltName=DNS:s04.${LOCAL_DOMAIN}") > ${SSL_CONFIG}
|
2022-08-23 14:11:03 +00:00
|
|
|
@echo $(test -e "${STORAGE_DIR}/s04tls.key" && echo true)
|
|
|
|
@if [ ! -e "${STORAGE_DIR}/s04tls.key" ]; then \
|
|
|
|
openssl req -new -newkey rsa:4096 -x509 -sha256 -days 365 -nodes \
|
|
|
|
-subj "/C=RU/ST=SPB/L=St.Petersburg/O=NSPCC/OU=NSPCC/CN=s04.${LOCAL_DOMAIN}" \
|
|
|
|
-keyout "${STORAGE_DIR}/s04tls.key" -out "${STORAGE_DIR}/s04tls.crt" \
|
|
|
|
-extensions san -config "${SSL_CONFIG}" ; \
|
|
|
|
fi
|