Commit c8431a5b authored by pasden's avatar pasden 💬
Browse files

Fix enable_encrypt_self-sign.sh

parent e1aea8b1
#!/bin/sh
container_name="itinvent"
host_name="yourHost"
CONTAINER_NAME="itinvent"
HOST_NAME="yourHost"
docker exec -it $container_name /bin/sh -c "\
docker exec -u 0:0 -it $CONTAINER_NAME /bin/sh -c "\
cd /var/opt/mssql/data/; \
openssl req -x509 -nodes -newkey rsa:2048 -subj '/CN=${host_name}' \
-keyout mssql.key \
-out cert.pem \
-days 365; \
openssl req -x509 -nodes -newkey rsa:2048 -subj '/CN=${HOST_NAME}' \
-keyout mssql.key \
-out cert.pem \
-days 365; \
chmod 600 ./cert.pem ./mssql.key; \
chown root:root ./cert.pem ./mssql.key; \
chown 10001:0 ./cert.pem ./mssql.key; \
/opt/mssql/bin/mssql-conf set network.tlscert /var/opt/mssql/data/cert.pem; \
/opt/mssql/bin/mssql-conf set network.tlskey /var/opt/mssql/data/mssql.key; \
/opt/mssql/bin/mssql-conf set network.tlsprotocols 1.2; \
/opt/mssql/bin/mssql-conf set network.forceencryption 1; \
/opt/mssql/bin/mssql-conf set network.forceencryption 0; \
"
docker restart $container_name
docker logs -f $container_name
# after set the settings, restart the container!
#docker restart $CONTAINER_NAME
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment