9 cert=../apps/server.pem
13 OPENSSL_CONF=/dev/null ; export OPENSSL_CONF
14 ssltest="../util/shlib_wrap.sh ./ssltest -key $key -cert $cert -c_key $key -c_cert $cert"
16 if ../util/shlib_wrap.sh ../apps/openssl x509 -in $cert -text -noout | fgrep 'DSA Public Key' >/dev/null; then
22 if [ "$3" = "" ]; then
28 if [ "$4" = "" ]; then
34 serverinfo="./serverinfo.pem"
36 #############################################################################
39 $ssltest -ssl3 $extra || exit 1
41 echo test sslv3 with server authentication
42 $ssltest -ssl3 -server_auth $CA $extra || exit 1
44 echo test sslv3 with client authentication
45 $ssltest -ssl3 -client_auth $CA $extra || exit 1
47 echo test sslv3 with both client and server authentication
48 $ssltest -ssl3 -server_auth -client_auth $CA $extra || exit 1
51 $ssltest $extra || exit 1
53 echo test sslv2/sslv3 with server authentication
54 $ssltest -server_auth $CA $extra || exit 1
56 echo test sslv2/sslv3 with client authentication
57 $ssltest -client_auth $CA $extra || exit 1
59 echo test sslv2/sslv3 with both client and server authentication
60 $ssltest -server_auth -client_auth $CA $extra || exit 1
62 echo test sslv3 via BIO pair
63 $ssltest -bio_pair -ssl3 $extra || exit 1
65 echo test sslv3 with server authentication via BIO pair
66 $ssltest -bio_pair -ssl3 -server_auth $CA $extra || exit 1
68 echo test sslv3 with client authentication via BIO pair
69 $ssltest -bio_pair -ssl3 -client_auth $CA $extra || exit 1
71 echo test sslv3 with both client and server authentication via BIO pair
72 $ssltest -bio_pair -ssl3 -server_auth -client_auth $CA $extra || exit 1
74 echo test sslv2/sslv3 via BIO pair
75 $ssltest $extra || exit 1
78 $ssltest -dtls1 $extra || exit 1
80 echo test dtlsv1 with server authentication
81 $ssltest -dtls1 -server_auth $CA $extra || exit 1
83 echo test dtlsv1 with client authentication
84 $ssltest -dtls1 -client_auth $CA $extra || exit 1
86 echo test dtlsv1 with both client and server authentication
87 $ssltest -dtls1 -server_auth -client_auth $CA $extra || exit 1
90 $ssltest -dtls12 $extra || exit 1
92 echo test dtlsv1.2 with server authentication
93 $ssltest -dtls12 -server_auth $CA $extra || exit 1
95 echo test dtlsv1.2 with client authentication
96 $ssltest -dtls12 -client_auth $CA $extra || exit 1
98 echo test dtlsv1.2 with both client and server authentication
99 $ssltest -dtls12 -server_auth -client_auth $CA $extra || exit 1
101 if [ $dsa_cert = NO ]; then
102 echo 'test sslv2/sslv3 w/o (EC)DHE via BIO pair'
103 $ssltest -bio_pair -no_dhe -no_ecdhe $extra || exit 1
106 echo test sslv2/sslv3 with 1024bit DHE via BIO pair
107 $ssltest -bio_pair -dhe1024dsa -v $extra || exit 1
109 echo test sslv2/sslv3 with server authentication
110 $ssltest -bio_pair -server_auth $CA $extra || exit 1
112 echo test sslv2/sslv3 with client authentication via BIO pair
113 $ssltest -bio_pair -client_auth $CA $extra || exit 1
115 echo test sslv2/sslv3 with both client and server authentication via BIO pair
116 $ssltest -bio_pair -server_auth -client_auth $CA $extra || exit 1
118 echo test sslv2/sslv3 with both client and server authentication via BIO pair and app verify
119 $ssltest -bio_pair -server_auth -client_auth -app_verify $CA $extra || exit 1
121 echo "Testing ciphersuites"
122 for protocol in TLSv1.2 SSLv3; do
123 echo "Testing ciphersuites for $protocol"
124 for cipher in `../util/shlib_wrap.sh ../apps/openssl ciphers "RSA+$protocol" | tr ':' ' '`; do
125 echo "Testing $cipher"
127 if [ $protocol = "SSLv3" ] ; then
130 $ssltest -cipher $cipher $prot
131 if [ $? -ne 0 ] ; then
132 echo "Failed $cipher"
138 #############################################################################
140 if ../util/shlib_wrap.sh ../apps/openssl no-dh; then
141 echo skipping anonymous DH tests
143 echo test tls1 with 1024bit anonymous DH, multiple handshakes
144 $ssltest -v -bio_pair -tls1 -cipher ADH -dhe1024dsa -num 10 -f -time $extra || exit 1
147 if ../util/shlib_wrap.sh ../apps/openssl no-rsa; then
148 echo skipping RSA tests
150 echo 'test tls1 with 1024bit RSA, no (EC)DHE, multiple handshakes'
151 ../util/shlib_wrap.sh ./ssltest -v -bio_pair -tls1 -cert ../apps/server2.pem -no_dhe -no_ecdhe -num 10 -f -time $extra || exit 1
153 if ../util/shlib_wrap.sh ../apps/openssl no-dh; then
154 echo skipping RSA+DHE tests
156 echo test tls1 with 1024bit RSA, 1024bit DHE, multiple handshakes
157 ../util/shlib_wrap.sh ./ssltest -v -bio_pair -tls1 -cert ../apps/server2.pem -dhe1024dsa -num 10 -f -time $extra || exit 1
161 echo test tls1 with PSK
162 $ssltest -tls1 -cipher PSK -psk abc123 $extra || exit 1
164 echo test tls1 with PSK via BIO pair
165 $ssltest -bio_pair -tls1 -cipher PSK -psk abc123 $extra || exit 1
167 #############################################################################
168 # Next Protocol Negotiation Tests
170 $ssltest -bio_pair -tls1 -npn_client || exit 1
171 $ssltest -bio_pair -tls1 -npn_server || exit 1
172 $ssltest -bio_pair -tls1 -npn_server_reject || exit 1
173 $ssltest -bio_pair -tls1 -npn_client -npn_server_reject || exit 1
174 $ssltest -bio_pair -tls1 -npn_client -npn_server || exit 1
175 $ssltest -bio_pair -tls1 -npn_client -npn_server -num 2 || exit 1
176 $ssltest -bio_pair -tls1 -npn_client -npn_server -num 2 -reuse || exit 1
178 #############################################################################
179 # Custom Extension tests
181 echo test tls1 with custom extensions
182 $ssltest -bio_pair -tls1 -custom_ext || exit 1
184 #############################################################################
187 echo test tls1 with serverinfo
188 $ssltest -bio_pair -tls1 -serverinfo_file $serverinfo || exit 1
189 $ssltest -bio_pair -tls1 -serverinfo_file $serverinfo -serverinfo_sct || exit 1
190 $ssltest -bio_pair -tls1 -serverinfo_file $serverinfo -serverinfo_tack || exit 1
191 $ssltest -bio_pair -tls1 -serverinfo_file $serverinfo -serverinfo_sct -serverinfo_tack || exit 1
192 $ssltest -bio_pair -tls1 -custom_ext -serverinfo_file $serverinfo -serverinfo_sct -serverinfo_tack || exit 1
195 #############################################################################
198 $ssltest -bio_pair -tls1 -alpn_client foo -alpn_server bar || exit 1
199 $ssltest -bio_pair -tls1 -alpn_client foo -alpn_server foo -alpn_expected foo || exit 1
200 $ssltest -bio_pair -tls1 -alpn_client foo,bar -alpn_server foo -alpn_expected foo || exit 1
201 $ssltest -bio_pair -tls1 -alpn_client bar,foo -alpn_server foo -alpn_expected foo || exit 1
202 $ssltest -bio_pair -tls1 -alpn_client bar,foo -alpn_server foo,bar -alpn_expected foo || exit 1
203 $ssltest -bio_pair -tls1 -alpn_client bar,foo -alpn_server bar,foo -alpn_expected bar || exit 1
204 $ssltest -bio_pair -tls1 -alpn_client foo,bar -alpn_server bar,foo -alpn_expected bar || exit 1
205 $ssltest -bio_pair -tls1 -alpn_client baz -alpn_server bar,foo || exit 1
207 if ../util/shlib_wrap.sh ../apps/openssl no-srp; then
208 echo skipping SRP tests
210 echo test tls1 with SRP
211 $ssltest -tls1 -cipher SRP -srpuser test -srppass abc123
213 echo test tls1 with SRP via BIO pair
214 $ssltest -bio_pair -tls1 -cipher SRP -srpuser test -srppass abc123
216 echo test tls1 with SRP auth
217 $ssltest -tls1 -cipher aSRP -srpuser test -srppass abc123
219 echo test tls1 with SRP auth via BIO pair
220 $ssltest -bio_pair -tls1 -cipher aSRP -srpuser test -srppass abc123
223 #############################################################################
226 if [ -z "$extra" -a `uname -m` = "x86_64" ]; then
227 $ssltest -cipher AES128-SHA -bytes 8m || exit 1
228 $ssltest -cipher AES128-SHA256 -bytes 8m || exit 1