Last change
on this file was 115, checked in by george, 15 years ago |
- Upraveno: Různé systémové shellové skripty.
|
-
Property svn:executable
set to
*
|
File size:
989 bytes
|
Line | |
---|
1 | #!/bin/sh
|
---|
2 |
|
---|
3 | cd /etc/pki/tls/certs
|
---|
4 |
|
---|
5 | SERVER=centrala.zdechov.net
|
---|
6 | PRIVATE_KEY=$SERVER.key
|
---|
7 | CERTIFICATE_FILE=$SERVER.crt
|
---|
8 | VALID_DAYS=365
|
---|
9 |
|
---|
10 | cd /etc/pki/tls/certs
|
---|
11 | echo Delete old private key
|
---|
12 | rm $PRIVATE_KEY
|
---|
13 | echo Create new private/public-keys without passphrase for server
|
---|
14 | openssl genrsa -out $PRIVATE_KEY 1024
|
---|
15 | cp /etc/pki/tls/certs/$PRIVATE_KEY /etc/pki/tls/private/$PRIVATE_KEY
|
---|
16 |
|
---|
17 | echo Create selfsigned certificate
|
---|
18 | rm $CERTIFICATE_FILE
|
---|
19 | # From man req:
|
---|
20 | # -x509
|
---|
21 | # this option outputs a self signed certificate instead
|
---|
22 | # of a certificate request. This is typically used to
|
---|
23 | # generate a test certificate or a self signed root CA.
|
---|
24 | # The extensions added to the certificate (if any) are
|
---|
25 | # specified in the configuration file.
|
---|
26 |
|
---|
27 | cd /etc/pki/tls/certs
|
---|
28 | openssl req -new -days $VALID_DAYS -key $PRIVATE_KEY -x509 -out $CERTIFICATE_FILE
|
---|
29 |
|
---|
30 | echo private-keyfile is $PRIVATE_KEY
|
---|
31 | echo server-certificate-file is $CERTIFICATE_FILE
|
---|
32 |
|
---|
33 | ls -l $PRIVATE_KEY $CERTIFICATE_FILE |
---|
Note:
See
TracBrowser
for help on using the repository browser.