-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathgen_ssl.sh
More file actions
executable file
·57 lines (48 loc) · 920 Bytes
/
Copy pathgen_ssl.sh
File metadata and controls
executable file
·57 lines (48 loc) · 920 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/bin/bash
name=server
our_name=server-$(date +%s)
our_crt=${our_name}.crt
our_key=${our_name}.key
our_passkey=${our_name}.pass.key
our_csr=${our_name}.csr
openssl genrsa \
-des3 \
-passout pass:x \
-out ${our_passkey} \
2048 \
&> /dev/null
openssl rsa \
-passin pass:x \
-in ${our_passkey}\
-out ${our_key} \
&> /dev/null
openssl req \
-new \
-key ${our_key} \
-out ${our_csr} \
-subj "/C=US/ST=Texas/L=Austin/O=Out Systems/OU=IT/CN=k0s.local" \
&> /dev/null
openssl x509 \
-req \
-sha256 \
-days 365 \
-in ${our_csr} \
-signkey ${our_key} \
-out ${our_crt} \
&> /dev/null
sudo security add-trusted-cert \
-d \
-r trustRoot \
-k /Library/Keychains/System.keychain \
./${our_crt}
sudo security find-certificate \
-c k0s.local \
-a \
-Z
sudo security delete-certificate \
-c k0s.local
rm \
${our_crt} \
${our_passkey} \
${our_csr} \
${our_key}