]> git.saurik.com Git - apple/security.git/blob - SecurityTests/clxutils/sslScripts/openssl/runServeView
Security-57031.1.35.tar.gz
[apple/security.git] / SecurityTests / clxutils / sslScripts / openssl / runServeView
1 #!/bin/csh
2 # openssl/certtool/sslServer compatibility
3 #
4 #
5 # certtool arguments
6 #
7 set KC_NAME=opensslkc
8 set CERT_FILE_PEM=new.cert.pem
9 set CERT_FILE_DER=new.cert.der
10 set PRIV_RAW_KEY_PEM=new.key.pem
11 #
12 #
13 # Prepare to import
14 #
15 echo Preparing to delete keychain $KC_NAME. Ctl-c to abort, or....
16 doprompt
17 rm -f ~/Library/Keychains/$KC_NAME
18 #
19 # Do the import
20 # Cert and key both in PEM Format
21 #
22 set cmd="certtool i $CERT_FILE_PEM k=$KC_NAME c r=$PRIV_RAW_KEY_PEM f=1 p=$KC_NAME"
23 echo $cmd
24 $cmd || exit(1)
25 #
26 # Run an SSL session using this cert/priv key
27 #
28 set cmd="sslServer k=$KC_NAME z=$KC_NAME"
29 echo $cmd
30 $cmd &
31 #
32 # wait for server to settle down
33 #
34 sleep 2
35 #
36 # and one ping with cert dump
37 #
38 set cmd="sslViewer localhost P=1200 c t a $CERT_FILE_DER"
39 echo $cmd
40 $cmd || exit(1)
41 echo === Complete ===