File: tls_example.in

package info (click to toggle)
polyorb 2.6.0~20090423-10
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 25,004 kB
  • ctags: 240
  • sloc: ada: 236,464; makefile: 2,281; sh: 1,373; cpp: 957; java: 500; ansic: 198; python: 191; perl: 23; exp: 6
file content (29 lines) | stat: -rw-r--r-- 770 bytes parent folder | download | duplicates (2)
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
#!/bin/sh

rm -rf .ca
mkdir .ca
touch .ca/index.txt
echo "01" > .ca/serial
openssl genrsa -out root.key 2048
openssl req -new -x509 -key root.key -out root.crt \
    -config ./ca_openssl.conf
openssl genrsa -out polyorb.key 2048
openssl req -new -key polyorb.key -out polyorb.req \
    -config ./polyorb_openssl.conf
printf "y\ny\n" | openssl ca -keyfile root.key -cert root.crt \
    -in polyorb.req -out polyorb.crt \
    -config ./ca_openssl.conf || true
rm -rf .ca

trap "killall server client; rm -f ior" 0 1 2 3 15

POLYORB_CONF=tls.conf ./server | tee ior &

j=0
while [ $j -lt 20 ]; do
    [ -f ior ] && [ `wc -l ior | cut -d ' ' -f 1` -ne 0 ] && break
    sleep 1
    j=`expr $j + 1`
done

POLYORB_CONF=tls.conf ./client `cat ior | head -n 1 | cut -d "'" -f 2`