Add generate server cert and add ssl for application
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
parent
f6c0a31fc1
commit
83bc97bb02
@ -1,2 +0,0 @@
|
||||
server:
|
||||
port: ${APP_PORT:8080}
|
@ -1,3 +1,13 @@
|
||||
server:
|
||||
port: ${SERVER_PORT:8080}
|
||||
ssl:
|
||||
key-store: ${SERVER_SSL_KEY_STORE:classpath:keystore/server.jks}
|
||||
key-store-password: ${SERVER_SSL_KEY_STORE_PASSWORD:cubetiq}
|
||||
key-password: ${SERVER_SSL_KEY_PASSWORD:cubetiq}
|
||||
enabled: ${SERVER_SSL_ENABLED:true}
|
||||
compression:
|
||||
enabled: ${SERVER_COMPRESSION_ENABLED:${server.ssl.enabled}}
|
||||
|
||||
spring:
|
||||
profiles:
|
||||
active: ${APP_PROFILE:demo}
|
||||
|
BIN
api/src/main/resources/keystore/server.jks
Normal file
BIN
api/src/main/resources/keystore/server.jks
Normal file
Binary file not shown.
BIN
api/src/main/resources/keystore/server.p12
Normal file
BIN
api/src/main/resources/keystore/server.p12
Normal file
Binary file not shown.
18
generate-server-cert.sh
Executable file
18
generate-server-cert.sh
Executable file
@ -0,0 +1,18 @@
|
||||
#!/bin/sh -e
|
||||
|
||||
CERT_NAME="${1:-server}"
|
||||
CERT_SIZE="${2:-2048}"
|
||||
CERT_DAYS="${3:-3650}"
|
||||
DEST_DIR="${4:-./}"
|
||||
|
||||
echo "Create directory ${DEST_DIR}"
|
||||
mkdir -p "${DEST_DIR}"
|
||||
|
||||
echo "Generating server keystore ${CERT_NAME}.p12 with size: ${CERT_SIZE} days: ${CERT_DAYS}"
|
||||
keytool -genkeypair -alias ${CERT_NAME} -keyalg RSA -keysize ${CERT_SIZE} -storetype PKCS12 -keystore ${DEST_DIR}${CERT_NAME}.p12 -validity ${CERT_DAYS}
|
||||
|
||||
echo "Generating server keystore ${CERT_NAME}.jks with size: ${CERT_SIZE} days: ${CERT_DAYS}"
|
||||
keytool -genkeypair -alias ${CERT_NAME} -keyalg RSA -keysize ${CERT_SIZE} -keystore ${DEST_DIR}${CERT_NAME}.jks -validity ${CERT_DAYS}
|
||||
|
||||
echo "Import keystore ${CERT_NAME}.jks into ${CERT_NAME}.p12"
|
||||
keytool -importkeystore -srckeystore ${DEST_DIR}${CERT_NAME}.jks -destkeystore ${DEST_DIR}${CERT_NAME}.p12 -deststoretype pkcs12
|
Loading…
Reference in New Issue
Block a user