#!/bin/bash

# Frank Bergmann http://www.tuxad.com

ret=$(
 openssl s_client -connect "${1-`hostname`}:${2-443}" -ssl3\
 2>/dev/null </dev/null
)
if echo "${ret}" | grep -q 'CONNECTED'; then
  if echo "${ret}" | grep -q 'Protocol.*SSLv3'; then
    if echo "${ret}" | grep -q 'Cipher.*0000'; then
      echo "SSL 3.0 disabled"
    else
      echo "SSL 3.0 enabled"
    fi
  else
    echo "SSL 3.0 disabled"
  fi
else
  echo "unknown error"
fi
