#!/bin/sh# ocsp.test# Note, this script makes connection(s) to the public Internet.SCRIPT_DIR="$(dirname "$0")"server=www.globalsign.comca=certs/external/ca-globalsign-root.pem[ ! -x ./examples/client/client ] && printf '\n\n%s\n' "Client doesn't exist" \&& exit 1if ! ./examples/client/client -V | grep -q 3; thenecho 'skipping ocsp.test because TLS1.2 is not available.' 1>&2exit 77fiGL_UNREACHABLE=0# Global Sign now requires server name indication extension to work, check# enabled prior to testingOUTPUT=$(eval "./examples/client/client -S check")if [ "$OUTPUT" = "SNI is: ON" ]; thenprintf '\n\n%s\n\n' "SNI is on, proceed with globalsign test"if [ "$AM_BWRAPPED" != "yes" ]; then# is our desired server there?"${SCRIPT_DIR}/ping.test" $server 2RESULT=$?if [ $RESULT -ne 0 ]; thenGL_UNREACHABLE=1fielseRESULT=0fiif [ $RESULT -eq 0 ]; then# client test against the serverecho "./examples/client/client -X -C -h $server -p 443 -A \"$ca\" -g -o -N -v d -S $server"./examples/client/client -X -C -h $server -p 443 -A "$ca" -g -o -N -v d -S $serverGL_RESULT=$?[ $GL_RESULT -ne 0 ] && printf '\n\n%s\n' "Client connection failed"elseGL_RESULT=1fielseprintf '\n\n%s\n\n' "SNI disabled, skipping globalsign test"GL_RESULT=0fiserver=www.google.comca=certs/external/ca-google-root.pemif [ "$AM_BWRAPPED" != "yes" ]; then# is our desired server there?${SCRIPT_DIR}/ping.test $server 2RESULT=$?elseRESULT=0fiif [ $RESULT -eq 0 ]; then# client test against the serverecho "./examples/client/client -X -C -h $server -p 443 -A \"$ca\" -g -o -N"./examples/client/client -X -C -h $server -p 443 -A "$ca" -g -o -NGR_RESULT=$?[ $GR_RESULT -ne 0 ] && printf '\n\n%s\n' "Client connection failed"elseGR_RESULT=1fiif test -n "$WOLFSSL_OCSP_TEST"; then# check that both passedif [ $GL_RESULT -eq 0 ] && [ $GR_RESULT -eq 0 ]; thenprintf '\n\n%s\n' "Both OCSP connection to globalsign and google passed"printf '%s\n' "Test Passed!"exit 0elif [ $GL_UNREACHABLE -eq 1 ] && [ $GR_RESULT -eq 0 ]; thenprintf '%s\n' "Global Sign is currently unreachable. Logging it but if"printf '%s\n' "this continues to occur should be investigated"exit 0else# Unlike other environment variables the intent of WOLFSSL_OCSP_TEST# is to indicate a requirement for both tests to pass. If variable is# set and either tests fail then whole case fails. Do not set the# variable if either case passing is to be considered a success.printf '\n\n%s\n' "One of the OCSP connections to either globalsign or"printf '%s\n' "google failed, however since WOLFSSL_OCSP_TEST is set"printf '%s\n' "the test is considered to have failed"printf '%s\n' "Test Failed!"exit 1fielse# if environment variable is not set then just need one to passif [ $GL_RESULT -ne 0 ] && [ $GR_RESULT -ne 0 ]; thenprintf '\n\n%s\n' "Both OCSP connection to globalsign and google failed"printf '%s\n' "Test Failed!"exit 77elseprintf '\n\n%s\n' "WOLFSSL_OCSP_TEST NOT set, and 1 of the tests passed"printf '%s\n' "Test Passed!"exit 0fifi
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。