summaryrefslogtreecommitdiffstats
path: root/security/nss/tests/iopr/ssl_iopr.sh
blob: 0f9742662d78f5145a272caf9e2d141c1010925a (plain)
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
#! /bin/bash
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

########################################################################
#
# mozilla/security/nss/tests/iopr/ssl_iopr.sh
#
# NSS SSL interoperability QA. This file is included from ssl.sh
#
# needs to work on all Unix and Windows platforms
#
# special strings
# ---------------
#   FIXME ... known problems, search for this string
#   NOTE .... unexpected behavior
########################################################################
IOPR_SSL_SOURCED=1

########################################################################
# The functions works with variables defined in interoperability 
# configuration file that was downloaded from a webserver.
# It tries to find unrevoked cert based on value of variable
# "SslClntValidCertName" defined in the configuration file.
# Params NONE.
# Returns 0 if found, 1 otherwise.
#
setValidCert() {
    testUser=$SslClntValidCertName
    [ -z "$testUser" ] && return 1
    return 0
}

########################################################################
# The funtions works with variables defined in interoperability 
# configuration file that was downloaded from a webserver.
# The function sets port, url, param and description test parameters
# that was defind for a particular type of testing.
# Params:
#      $1 - supported types of testing. Currently have maximum
#           of two: forward and reverse. But more can be defined. 
# No return value
#
setTestParam() {
    type=$1
    sslPort=`eval 'echo $'${type}Port`
    sslUrl=`eval 'echo $'${type}Url`
    testParam=`eval 'echo $'${type}Param`
    testDescription=`eval 'echo $'${type}Descr`
    [ -z "$sslPort" ] && sslPort=443
    [ -z "$sslUrl" ] && sslUrl="/iopr_test/test_pg.html"
    [ "$sslUrl" = "/" ] && sslUrl="/test_pg.html"
}


#######################################################################
# local shell function to perform SSL Cipher Suite Coverage tests
# in interoperability mode. Tests run against web server by using nss
# test client
# Params:
#      $1 - supported type of testing.
#      $2 - testing host
#      $3 - nss db location
# No return value
#  
ssl_iopr_cov_ext_server()
{
  testType=$1
  host=$2
  dbDir=$3

  setTestParam $testType
  if [ "`echo $testParam | grep NOCOV`" != "" ]; then
      echo "SSL Cipher Coverage of WebServ($IOPR_HOSTADDR) excluded from " \
           "run by server configuration"
      return 0
  fi

  html_head "SSL Cipher Coverage of WebServ($IOPR_HOSTADDR" \
      "$BYPASS_STRING $NORM_EXT): $testDescription"

  setValidCert; ret=$?
  if [ $ret -ne 0 ]; then
      html_failed "Fail to find valid test cert(ws: $host)" 
      return $ret
  fi

  SSL_REQ_FILE=${TMP}/sslreq.dat.$$
  echo "GET $sslUrl HTTP/1.0" > $SSL_REQ_FILE
  echo >> $SSL_REQ_FILE
  
  while read ecc tls param testname therest; do
      [ -z "$ecc" -o "$ecc" = "#" -o "`echo $testname | grep FIPS`" -o \
          "$ecc" = "ECC" ] && continue; 
      
      echo "$SCRIPTNAME: running $testname ----------------------------"
      TLS_FLAG=-T
      if [ "$tls" = "TLS" ]; then
          TLS_FLAG=""
      fi
      
      resFile=${TMP}/$HOST.tmpRes.$$
      rm $resFile 2>/dev/null
      
      echo "tstclnt -p ${sslPort} -h ${host} -c ${param} ${TLS_FLAG} \\"
      echo "      -n $testUser -v -w nss ${CLIEN_OPTIONS} -f \\"
      echo "      -d ${dbDir} < ${SSL_REQ_FILE} > $resFile"
      
      ${BINDIR}/tstclnt -p ${sslPort} -h ${host} -c ${param} \
          ${TLS_FLAG} ${CLIEN_OPTIONS} -f -n $testUser -v -w nss \
          -d ${dbDir} < ${SSL_REQ_FILE} >$resFile  2>&1
      ret=$?
      grep "ACCESS=OK" $resFile
      test $? -eq 0 -a $ret -eq 0
      ret=$?
      [ $ret -ne 0 ] && cat $resFile
      rm -f $resFile 2>/dev/null
      html_msg $ret 0 "${testname}"
  done < ${SSLCOV}
  rm -f $SSL_REQ_FILE 2>/dev/null

  html "</TABLE><BR>"
}

#######################################################################
# local shell function to perform SSL  Client Authentication tests
# in interoperability mode. Tests run against web server by using nss
# test client
# Params:
#      $1 - supported type of testing.
#      $2 - testing host
#      $3 - nss db location
# No return value
#  
ssl_iopr_auth_ext_server()
{
  testType=$1
  host=$2
  dbDir=$3

  setTestParam $testType
  if [ "`echo $testParam | grep NOAUTH`" != "" ]; then
      echo "SSL Client Authentication WebServ($IOPR_HOSTADDR) excluded from " \
           "run by server configuration"
      return 0
  fi

  html_head "SSL Client Authentication WebServ($IOPR_HOSTADDR $BYPASS_STRING $NORM_EXT):
             $testDescription"

  setValidCert;ret=$?
  if [ $ret -ne 0 ]; then
      html_failed "Fail to find valid test cert(ws: $host)" 
      return $ret
  fi

  SSL_REQ_FILE=${TMP}/sslreq.dat.$$
  echo "GET $sslUrl HTTP/1.0" > $SSL_REQ_FILE
  echo >> $SSL_REQ_FILE
  
  SSLAUTH_TMP=${TMP}/authin.tl.tmp
  grep -v "^#" ${SSLAUTH} | grep -- "-r_-r_-r_-r" > ${SSLAUTH_TMP}

  while read ecc value sparam cparam testname; do
      [ -z "$ecc" -o "$ecc" = "#" -o "$ecc" = "ECC" ] && continue;

      cparam=`echo $cparam | sed -e 's;_; ;g' -e "s/TestUser/$testUser/g" `
      
      echo "tstclnt -p ${sslPort} -h ${host} ${CLIEN_OPTIONS} -f ${cparam} \\"
      echo "         -d ${dbDir} -v < ${SSL_REQ_FILE}"
      
      resFile=${TMP}/$HOST.tmp.$$
      rm $rsFile 2>/dev/null

      ${BINDIR}/tstclnt -p ${sslPort} -h ${host} ${CLIEN_OPTIONS} -f ${cparam} \
          -d ${dbDir} -v < ${SSL_REQ_FILE} >$resFile  2>&1
      ret=$?
      grep "ACCESS=OK" $resFile
      test $? -eq 0 -a $ret -eq 0
      ret=$?
      [ $ret -ne 0 ] && cat $resFile
      rm $resFile 2>/dev/null
      
      html_msg $ret $value "${testname}. Client params: $cparam"\
          "produced a returncode of $ret, expected is $value"
  done < ${SSLAUTH_TMP}
  rm -f ${SSLAUTH_TMP} ${SSL_REQ_FILE}

  html "</TABLE><BR>"
}

########################################################################
# local shell function to perform SSL interoperability test with/out
# revoked certs tests. Tests run against web server by using nss
# test client
# Params:
#      $1 - supported type of testing.
#      $2 - testing host
#      $3 - nss db location
# No return value
#  
ssl_iopr_crl_ext_server()
{
  testType=$1
  host=$2
  dbDir=$3

  setTestParam $testType
  if [ "`echo $testParam | grep NOCRL`" != "" ]; then
      echo "CRL SSL Client Tests of WebServerv($IOPR_HOSTADDR) excluded from " \
           "run by server configuration"
      return 0
  fi

  html_head "CRL SSL Client Tests of WebServer($IOPR_HOSTADDR $BYPASS_STRING $NORM_EXT): $testDescription"
  
  SSL_REQ_FILE=${TMP}/sslreq.dat.$$
  echo "GET $sslUrl HTTP/1.0" > $SSL_REQ_FILE
  echo >> $SSL_REQ_FILE
  
  SSLAUTH_TMP=${TMP}/authin.tl.tmp
  grep -v "^#" ${SSLAUTH} | grep -- "-r_-r_-r_-r" | grep -v bogus | \
      grep -v none > ${SSLAUTH_TMP}

  while read ecc value sparam _cparam testname; do
      [ -z "$ecc" -o "$ecc" = "#" -o "$ecc" = "ECC" ] && continue;

      rev_modvalue=254
      for testUser in $SslClntValidCertName $SslClntRevokedCertName; do
          cparam=`echo $_cparam | sed -e 's;_; ;g' -e "s/TestUser/$testUser/g" `
	  
          echo "tstclnt -p ${sslPort} -h ${host} ${CLIEN_OPTIONS} \\"
          echo "        -f -d ${dbDir} -v ${cparam}  < ${SSL_REQ_FILE}"
          resFile=${TMP}/$HOST.tmp.$$
          rm -f $resFile 2>/dev/null
          ${BINDIR}/tstclnt -p ${sslPort} -h ${host} ${CLIEN_OPTIONS} -f ${cparam} \
              -d ${dbDir} -v < ${SSL_REQ_FILE} \
              > $resFile  2>&1
          ret=$?
          grep "ACCESS=OK" $resFile
          test $? -eq 0 -a $ret -eq 0
          ret=$?
          [ $ret -ne 0 ] && ret=$rev_modvalue;
          [ $ret -ne 0 ] && cat $resFile
          rm -f $resFile 2>/dev/null

          if [ "`echo $SslClntRevokedCertName | grep $testUser`" != "" ]; then
              modvalue=$rev_modvalue
              testAddMsg="revoked"
          else
              testAddMsg="not revoked"
              modvalue=$value
          fi
          html_msg $ret $modvalue "${testname} (cert ${testUser} - $testAddMsg)" \
              "produced a returncode of $ret, expected is $modvalue"
      done
  done < ${SSLAUTH_TMP}
  rm -f ${SSLAUTH_TMP} ${SSL_REQ_FILE}
  
  html "</TABLE><BR>"
}


########################################################################
# local shell function to perform SSL Cipher Coverage tests of nss server
# by invoking remote test client on web server side.
# Invoked only if reverse testing is supported by web server.
# Params:
#      $1 - remote web server host
#      $2 - open port to connect to invoke CGI script
#      $3 - host where selfserv is running(name of the host nss tests
#           are running)
#      $4 - port where selfserv is running
#      $5 - selfserv nss db location
# No return value
#  
ssl_iopr_cov_ext_client()
{
  host=$1
  port=$2
  sslHost=$3
  sslPort=$4
  serDbDir=$5

  html_head "SSL Cipher Coverage of SelfServ $IOPR_HOSTADDR. $BYPASS_STRING $NORM_EXT"

  setValidCert
  ret=$?
  if [ $res -ne 0 ]; then
      html_failed "Fail to find valid test cert(ws: $host)" 
      return $ret
  fi

  # P_R_SERVERDIR switch require for selfserv to work.
  # Will be restored after test
  OR_P_R_SERVERDIR=$P_R_SERVERDIR
  P_R_SERVERDIR=$serDbDir
  OR_P_R_CLIENTDIR=$P_R_CLIENTDIR
  P_R_CLIENTDIR=$serDbDir
  testname=""
  sparam="-vvvc ABCDEFcdefgijklmnvyz"
  # Launch the server
  start_selfserv 
  
  while read ecc tls param cipher therest; do
      [ -z "$ecc" -o "$ecc" = "#" -o "$ecc" = "ECC" ] && continue;
      echo "============= Beginning of the test ===================="
      echo
      
      is_selfserv_alive
      
      TEST_IN=${TMP}/${HOST}_IN.tmp.$$
      TEST_OUT=${TMP}/$HOST.tmp.$$
      rm -f $TEST_IN $TEST_OUT 2>/dev/null
      
      echo "GET $reverseRunCGIScript?host=$sslHost&port=$sslPort&cert=$testUser&cipher=$cipher HTTP/1.0" > $TEST_IN
      echo >> $TEST_IN
      
      echo "------- Request ----------------------"
      cat $TEST_IN
      echo "------- Command ----------------------"
      echo tstclnt -d $serDbDir -v -w ${R_PWFILE} -o -p $port \
          -h $host \< $TEST_IN \>\> $TEST_OUT

      ${BINDIR}/tstclnt -d $serDbDir -v -w ${R_PWFILE} -o -p $port \
          -h $host <$TEST_IN > $TEST_OUT 

      echo "------- Server output Begin ----------"
      cat $TEST_OUT
      echo "------- Server output End   ----------"
      
      echo "Checking for errors in log file..."
      grep "SCRIPT=OK" $TEST_OUT 2>&1 >/dev/null
      if [ $? -eq 0 ]; then
          grep "cipher is not supported" $TEST_OUT 2>&1 >/dev/null
          if [ $? -eq 0 ]; then
              echo "Skiping test: no support for the cipher $cipher on server side"
              continue
          fi
          
          grep -i "SERVER ERROR:" $TEST_OUT
          ret=$?
          if [ $ret -eq 0 ]; then
              echo "Found problems. Reseting exit code to failure."
              
              ret=1
          else
              ret=0
          fi
      else
          echo "Script was not executed. Reseting exit code to failure."
          ret=11
      fi
      
      html_msg $ret 0 "Test ${cipher}. Server params: $sparam " \
          " produced a returncode of $ret, expected is 0"
      rm -f $TEST_OUT $TEST_IN 2>&1 > /dev/null
  done < ${SSLCOV}
  kill_selfserv
  
  P_R_SERVERDIR=$OR_P_R_SERVERDIR
  P_R_CLIENTDIR=$OR_P_R_CLIENTDIR
  
  rm -f ${TEST_IN} ${TEST_OUT}
  html "</TABLE><BR>"
}

########################################################################
# local shell function to perform SSL Authentication tests of nss server
# by invoking remove test client on web server side
# Invoked only if reverse testing is supported by web server.
# Params:
#      $1 - remote web server host
#      $2 - open port to connect to invoke CGI script
#      $3 - host where selfserv is running(name of the host nss tests
#           are running)
#      $4 - port where selfserv is running
#      $5 - selfserv nss db location
# No return value
#  
ssl_iopr_auth_ext_client()
{
  host=$1
  port=$2
  sslHost=$3
  sslPort=$4
  serDbDir=$5

  html_head "SSL Client Authentication with Selfserv from $IOPR_HOSTADDR. $BYPASS_STRING $NORM_EXT"

  setValidCert
  ret=$?
  if [ $res -ne 0 ]; then
      html_failed "Fail to find valid test cert(ws: $host)" 
      return $ret
  fi

  OR_P_R_SERVERDIR=$P_R_SERVERDIR
  P_R_SERVERDIR=${serDbDir}
  OR_P_R_CLIENTDIR=$P_R_CLIENTDIR
  P_R_CLIENTDIR=${serDbDir}

  SSLAUTH_TMP=${TMP}/authin.tl.tmp

  grep -v "^#" $SSLAUTH | grep "\s*0\s*" > ${SSLAUTH_TMP}

  while read ecc value sparam cparam testname; do
      [ -z "$ecc" -o "$ecc" = "#" -o "$ecc" = "ECC" ] && continue;

      echo "Server params: $sparam"
      sparam=$sparam" -vvvc ABCDEFcdefgijklmnvyz"
      start_selfserv
      
      TEST_IN=${TMP}/$HOST_IN.tmp.$$
      TEST_OUT=${TMP}/$HOST.tmp.$$
      rm -f $TEST_IN $TEST_OUT 2>/dev/null

      echo "GET $reverseRunCGIScript?host=$sslHost&port=$sslPort&cert=$testUser HTTP/1.0" > $TEST_IN
      echo >> $TEST_IN
      
      echo "------- Request ----------------------"
      cat $TEST_IN
      echo "------- Command ----------------------"
      echo tstclnt -d $serDbDir -v -w ${R_PWFILE} -o -p $port \
          -h $host \< $TEST_IN \>\> $TEST_OUT
      
      ${BINDIR}/tstclnt -d $serDbDir -v -w ${R_PWFILE} -o -p $port \
          -h $host <$TEST_IN > $TEST_OUT 
      
      echo "------- Server output Begin ----------"
      cat $TEST_OUT
      echo "------- Server output End   ----------"

      echo "Checking for errors in log file..."
      grep "SCRIPT=OK" $TEST_OUT 2>&1 >/dev/null
      if [ $? -eq 0 ]; then
          echo "Checking for error in log file..."
          grep -i "SERVER ERROR:" $TEST_OUT
          ret=$?
          if [ $ret -eq 0 ]; then
              echo "Found problems. Reseting exit code to failure."
              ret=1
          else
              ret=0
          fi
      else
          echo "Script was not executed. Reseting exit code to failure."
          ret=11
      fi
      
      html_msg $ret $value "${testname}. Server params: $sparam"\
          "produced a returncode of $ret, expected is $value"
      kill_selfserv
      rm -f $TEST_OUT $TEST_IN 2>&1 > /dev/null
  done < ${SSLAUTH_TMP}

  P_R_SERVERDIR=$OR_P_R_SERVERDIR
  P_R_CLIENTDIR=$OR_P_R_CLIENTDIR

  rm -f ${SSLAUTH_TMP} ${TEST_IN} ${TEST_OUT}
  html "</TABLE><BR>"
}

#########################################################################
# local shell function to perform SSL CRL testing of nss server
# by invoking remote test client on web server side
# Invoked only if reverse testing is supported by web server.
# Params:
#      $1 - remote web server host
#      $2 - open port to connect to invoke CGI script
#      $3 - host where selfserv is running(name of the host nss tests
#           are running)
#      $4 - port where selfserv is running
#      $5 - selfserv nss db location
# No return value
#  
ssl_iopr_crl_ext_client()
{
  host=$1
  port=$2
  sslHost=$3
  sslPort=$4
  serDbDir=$5

  html_head "CRL SSL Selfserv Tests from $IOPR_HOSTADDR. $BYPASS_STRING $NORM_EXT"
  
  OR_P_R_SERVERDIR=$P_R_SERVERDIR
  P_R_SERVERDIR=${serDbDir}
  OR_P_R_CLIENTDIR=$P_R_CLIENTDIR
  P_R_CLIENTDIR=$serDbDir

  SSLAUTH_TMP=${TMP}/authin.tl.tmp
  grep -v "^#" $SSLAUTH | grep "\s*0\s*" > ${SSLAUTH_TMP}

  while read ecc value sparam _cparam testname; do
      [ -z "$ecc" -o "$ecc" = "#" -o "$ecc" = "ECC" ] && continue;
      sparam="$sparam  -vvvc ABCDEFcdefgijklmnvyz"
      start_selfserv

      for testUser in $SslClntValidCertName $SslClntRevokedCertName; do
	  
          is_selfserv_alive
          
          TEST_IN=${TMP}/${HOST}_IN.tmp.$$
          TEST_OUT=${TMP}/$HOST.tmp.$$
          rm -f $TEST_IN $TEST_OUT 2>/dev/null

          echo "GET $reverseRunCGIScript?host=$sslHost&port=$sslPort&cert=$testUser HTTP/1.0" > $TEST_IN
          echo >> $TEST_IN
          
          echo "------- Request ----------------------"
          cat $TEST_IN
          echo "------- Command ----------------------"
          echo tstclnt -d $serDbDir -v -w ${R_PWFILE} -o -p $port \
              -h ${host} \< $TEST_IN \>\> $TEST_OUT
            
          ${BINDIR}/tstclnt -d $serDbDir -v -w ${R_PWFILE} -o -p $port \
              -h ${host} <$TEST_IN > $TEST_OUT 
          echo "------- Request ----------------------"
          cat $TEST_IN
          echo "------- Server output Begin ----------"
          cat $TEST_OUT
          echo "------- Server output End   ----------"
          
          echo "Checking for errors in log file..."
          grep "SCRIPT=OK" $TEST_OUT 2>&1 >/dev/null
          if [ $? -eq 0 ]; then
              grep -i "SERVER ERROR:" $TEST_OUT
              ret=$?
              if [ $ret -eq 0 ]; then
                  echo "Found problems. Reseting exit code to failure."
                  ret=1
              else
                  ret=0
              fi
          else
              echo "Script was not executed. Reseting exit code to failure."
              ret=11
          fi
          
          if [ "`echo $SslClntRevokedCertName | grep $testUser`" != "" ]; then
              modvalue=1
              testAddMsg="revoked"
          else
              testAddMsg="not revoked"
              modvalue=0
          fi
          
          html_msg $ret $modvalue "${testname} (cert ${testUser} - $testAddMsg)" \
		"produced a returncode of $ret, expected is $modvalue(selfserv args: $sparam)"
          rm -f $TEST_OUT $TEST_IN 2>&1 > /dev/null
      done
      kill_selfserv
  done < ${SSLAUTH_TMP}

  P_R_SERVERDIR=$OR_P_R_SERVERDIR
  P_R_CLIENTDIR=$OR_P_R_CLIENTDIR

  rm -f ${SSLAUTH_TMP}
  html "</TABLE><BR>"
}

#####################################################################
# Initial point for running ssl test againt multiple hosts involved in
# interoperability testing. Called from nss/tests/ssl/ssl.sh
# It will only proceed with test run for a specific host if environment variable 
# IOPR_HOSTADDR_LIST was set, had the host name in the list
# and all needed file were successfully downloaded and installed for the host.
#
# Returns 1 if interoperability testing is off, 0 otherwise. 
#
ssl_iopr_run() {
    if [ "$IOPR" -ne 1 ]; then
        return 1
    fi
    cd ${CLIENTDIR}
    
    ORIG_ECC_CERT=${NO_ECC_CERTS}
    NO_ECC_CERTS=1 # disable ECC for interoperability tests

    NSS_SSL_ENABLE_RENEGOTIATION=u
    export NSS_SSL_ENABLE_RENEGOTIATION

    num=1
    IOPR_HOST_PARAM=`echo "${IOPR_HOSTADDR_LIST} " | cut -f $num -d' '`
    while [ "$IOPR_HOST_PARAM" ]; do
        IOPR_HOSTADDR=`echo $IOPR_HOST_PARAM | cut -f 1 -d':'`
        IOPR_OPEN_PORT=`echo "$IOPR_HOST_PARAM:" | cut -f 2 -d':'`
        [ -z "$IOPR_OPEN_PORT" ] && IOPR_OPEN_PORT=443
        
        . ${IOPR_CADIR}_${IOPR_HOSTADDR}/iopr_server.cfg
        RES=$?
        
        if [ $RES -ne 0 -o X`echo "$wsFlags" | grep NOIOPR` != X ]; then
            num=`expr $num + 1`
            IOPR_HOST_PARAM=`echo "${IOPR_HOSTADDR_LIST} " | cut -f $num -d' '`
            continue
        fi
        
        #=======================================================
        # Check if server is capable to run ssl tests
        #
        [ -z "`echo ${supportedTests_new} | grep -i ssl`" ] && continue;

        # Testing directories defined by webserver.
        echo "Testing ssl interoperability.
                Client: local(tstclnt).
                Server: remote($IOPR_HOSTADDR:$IOPR_OPEN_PORT)"
        
        for sslTestType in ${supportedTests_new}; do
            if [ -z "`echo $sslTestType | grep -i ssl`" ]; then
                continue
            fi
            ssl_iopr_cov_ext_server $sslTestType ${IOPR_HOSTADDR} \
                ${IOPR_SSL_CLIENTDIR}_${IOPR_HOSTADDR}
            ssl_iopr_auth_ext_server $sslTestType ${IOPR_HOSTADDR} \
                ${IOPR_SSL_CLIENTDIR}_${IOPR_HOSTADDR}
            ssl_iopr_crl_ext_server $sslTestType ${IOPR_HOSTADDR} \
                ${IOPR_SSL_CLIENTDIR}_${IOPR_HOSTADDR}
        done
        
        
        # Testing selfserv with client located at the webserver.
        echo "Testing ssl interoperability.
                Client: remote($IOPR_HOSTADDR:$PORT)
                Server: local(selfserv)"
        ssl_iopr_cov_ext_client ${IOPR_HOSTADDR} ${IOPR_OPEN_PORT} \
            ${HOSTADDR} ${PORT} ${R_IOPR_SSL_SERVERDIR}_${IOPR_HOSTADDR}
        ssl_iopr_auth_ext_client ${IOPR_HOSTADDR} ${IOPR_OPEN_PORT} \
            ${HOSTADDR} ${PORT} ${R_IOPR_SSL_SERVERDIR}_${IOPR_HOSTADDR}
        ssl_iopr_crl_ext_client ${IOPR_HOSTADDR} ${IOPR_OPEN_PORT} \
            ${HOSTADDR} ${PORT} ${R_IOPR_SSL_SERVERDIR}_${IOPR_HOSTADDR}
        echo "================================================"
        echo "Done testing interoperability with $IOPR_HOSTADDR"
        num=`expr $num + 1`
        IOPR_HOST_PARAM=`echo "${IOPR_HOSTADDR_LIST} " | cut -f $num -d' '`
    done
    NO_ECC_CERTS=${ORIG_ECC_CERTS}
    return 0
}