blob: 539035ad58868fbb27869fa2e676b61386ef0048 (
plain) (
blame)
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
|
#!/bin/sh
# GNUnet TLS certificate shell scricpt
# Creates a TSL certificate to use with HTTPS transport plugin
if [ $# -ne 2 ]; then
exit 1
fi
rm -f $1 $2
# Create RSA Private Key
openssl genrsa -out $1 1024 2> /dev/null
if [ $? -ne 0 ]; then
rm -f $1 $2
exit 1
fi
# Create a self-signed certificate in batch mode using rsa key
openssl req -batch -days 365 -out $2 -new -x509 -key $1 2> /dev/null
if [ $? -ne 0 ]; then
rm -f $1 $2
exit 1
fi
chmod 0400 $1 $2
exit 0
|