printssl.sh revision 4638
6533N/A#
6533N/A# Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved.
6533N/A# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6533N/A#
6533N/A# This code is free software; you can redistribute it and/or modify it
6533N/A# under the terms of the GNU General Public License version 2 only, as
6533N/A# published by the Free Software Foundation.
6533N/A#
6533N/A# This code is distributed in the hope that it will be useful, but WITHOUT
6533N/A# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
6533N/A# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
6533N/A# version 2 for more details (a copy is included in the LICENSE file that
6533N/A# accompanied this code).
6533N/A#
6533N/A# You should have received a copy of the GNU General Public License version
6533N/A# 2 along with this work; if not, write to the Free Software Foundation,
6533N/A# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
6533N/A#
6533N/A# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
6533N/A# or visit www.oracle.com if you need additional information or have any
6533N/A# questions.
6533N/A#
6533N/A
6533N/A# @test
6533N/A# @bug 6480981
6533N/A# @summary keytool should be able to import certificates from remote SSL servers
6533N/A
6533N/Aif [ "${TESTSRC}" = "" ] ; then
6533N/A TESTSRC="."
6533N/Afi
6533N/Aif [ "${TESTJAVA}" = "" ] ; then
6533N/A echo "TESTJAVA not set. Test cannot execute."
6533N/A echo "FAILED!!!"
6533N/A exit 1
6533N/Afi
6533N/A
6533N/A# set platform-dependent variables
6533N/AOS=`uname -s`
6533N/Acase "$OS" in
6533N/A SunOS | Linux | Darwin )
6533N/A FS="/"
;;
CYGWIN* )
FS="/"
;;
Windows_* )
FS="\\"
;;
* )
echo "Unrecognized operating system!"
exit 1;
;;
esac
${TESTJAVA}${FS}bin${FS}javac -d . ${TESTSRC}${FS}PrintSSL.java || exit 10
${TESTJAVA}${FS}bin${FS}java -Dtest.src=$TESTSRC PrintSSL | ( read PORT; ${TESTJAVA}${FS}bin${FS}keytool -printcert -sslserver localhost:$PORT )
status=$?
rm PrintSSL*.class
exit $status