Use openssl.cnf config when generating new CSR

This commit is contained in:
Simon Unge 2024-09-10 17:20:41 +00:00
parent fcb90e4016
commit b2904404da
1 changed files with 2 additions and 2 deletions

View File

@ -52,11 +52,11 @@ $(DIR)/testca/cacert.pem:
$(DIR)/%/cert.pem: $(DIR)/testca/cacert.pem
$(gen_verbose) mkdir -p $(DIR)/$(TARGET)
$(verbose) { ( cd $(DIR)/$(TARGET) && \
sed -e 's/@HOSTNAME@/$(HOSTNAME)/g' $(CURDIR)/openssl.cnf.in > $(CURDIR)/openssl.cnf && \
openssl genrsa -out key.pem 2048 && \
openssl req -new -key key.pem -out req.pem -outform PEM \
openssl req -config $(CURDIR)/openssl.cnf -new -key key.pem -out req.pem -outform PEM \
-subj /C=UK/ST=England/CN=$(HOSTNAME)/O=$(TARGET)/L=$$$$/ -nodes && \
cd ../testca && \
sed -e 's/@HOSTNAME@/$(HOSTNAME)/g' $(CURDIR)/openssl.cnf.in > $(CURDIR)/openssl.cnf && \
openssl ca -config $(CURDIR)/openssl.cnf -in ../$(TARGET)/req.pem -out \
../$(TARGET)/cert.pem -notext -batch -extensions \
$(TARGET)_ca_extensions && \