added ssl
This commit is contained in:
23
Makefile
23
Makefile
@@ -1,4 +1,4 @@
|
||||
LIBRARIES = -Iinclude
|
||||
LIBRARIES = `pkg-config --libs openssl` -Iinclude
|
||||
SOURCES = ./src/* ./cmd/server.c
|
||||
OUTPUT_DIR = ./bin
|
||||
OUTPUT = -o ${OUTPUT_DIR}/PROG
|
||||
@@ -18,11 +18,20 @@ output_dir:
|
||||
|
||||
CERT_DIR = ./certs/
|
||||
|
||||
genCerts:
|
||||
mkdir -p ${CERT_DIR}
|
||||
openssl req -new -newkey ec -pkeyopt ec_paramgen_curve:prime256v1 \
|
||||
-x509 -nodes -days 365 -out ${CERT_DIR}cert.pem -keyout ${CERT_DIR}cert.pem \
|
||||
-subj "/C=US/ST=Some-State/L=[]/O=[]/CN=localhost"
|
||||
|
||||
clean:
|
||||
rm -rf $(OUTPUT_DIR) ${CERT_DIR} **.h.gch
|
||||
|
||||
genCerts:
|
||||
mkdir -p ${CERT_DIR}
|
||||
touch ${CERT_DIR}index.txt
|
||||
openssl req -x509 -newkey ec -pkeyopt ec_paramgen_curve:prime256v1 \
|
||||
-sha256 -nodes -out ${CERT_DIR}cacert.pem -keyout ${CERT_DIR}cakey.pem \
|
||||
-outform PEM -subj "/C=US/ST=Some-State/L=[]/O=[]/CN=localhost"
|
||||
openssl req -new -newkey ec -pkeyopt ec_paramgen_curve:prime256v1 \
|
||||
-nodes -days 365 -out ${CERT_DIR}cert.csr -keyout ${CERT_DIR}key.pem \
|
||||
-subj "/C=US/ST=Some-State/L=[]/O=[]/CN=localhost"
|
||||
openssl ca -policy signing_policy -extensions signing_req \
|
||||
-cert ./certs/cacert.pem -keyfile ./certs/cakey.pem \
|
||||
-rand_serial -config ./ca/ca.cnf \
|
||||
-out ./certs/cert.pem -infiles ./certs/cert.csr
|
||||
|
||||
|
||||
Reference in New Issue
Block a user