Skip to content

Instantly share code, notes, and snippets.

@fliiiix
Last active August 29, 2015 13:56

Revisions

  1. fliiiix revised this gist Feb 26, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion checkSSL.sh
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,7 @@
    #!/usr/bin/env bash

    # OpenSSL requires the port number.
    SERVER=192.168.1.11:443
    SERVER=s.ytimg.com:443
    DELAY=1
    ciphers=$(openssl ciphers 'ALL:eNULL' | sed -e 's/:/ /g')

  2. fliiiix created this gist Feb 26, 2014.
    26 changes: 26 additions & 0 deletions checkSSL.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,26 @@
    #!/usr/bin/env bash

    # OpenSSL requires the port number.
    SERVER=192.168.1.11:443
    DELAY=1
    ciphers=$(openssl ciphers 'ALL:eNULL' | sed -e 's/:/ /g')

    echo Obtaining cipher list from $(openssl version).

    for cipher in ${ciphers[@]}
    do
    echo -n Testing $cipher...
    result=$(echo -n | openssl s_client -cipher "$cipher" -connect $SERVER 2>&1)
    if [[ "$result" =~ "Cipher is " ]] ; then
    echo YES
    else
    if [[ "$result" =~ ":error:" ]] ; then
    error=$(echo -n $result | cut -d':' -f6)
    echo NO \($error\)
    else
    echo UNKNOWN RESPONSE
    echo $result
    fi
    fi
    sleep $DELAY
    done