-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathsetup_tls.sh
More file actions
24 lines (15 loc) · 976 Bytes
/
setup_tls.sh
File metadata and controls
24 lines (15 loc) · 976 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
red=$"\033[1;31m"
nc=$"\033[0m"
inverse=$"\033[7m"
green="\033[0;32m"
openssl req -x509 -newkey rsa:4096 -sha256 -days 3650 -nodes \
-keyout self.key -out self.crt -subj "/CN=code-server" \
-addext "subjectAltName=IP:$1"
cp self.crt ~/.local/share/code-server/localhost.crt
cp self.key ~/.local/share/code-server/localhost.key
echo -e "${green}Certificate and key installed in ~/.local/share/code-server/${nc}"
rm self.crt
rm self.key
echo -e "${red} Reloading code-server process"
echo -e "${red} Reload the browser, install the certificate into your cert authority, and ${inverse}restart your browser${nc}"
sudo systemctl restart code-server@$USER