Skip to content

Instantly share code, notes, and snippets.

@Apkawa
Created October 22, 2014 13:38
Show Gist options
  • Save Apkawa/c43427cfb17c8cc31f67 to your computer and use it in GitHub Desktop.
Save Apkawa/c43427cfb17c8cc31f67 to your computer and use it in GitHub Desktop.
Проверка ip домена на некорректный сертификат. (бывает, что в cdn забанены несколько адресов)
#!/bin/bash
while true
do
ip_list=$(dig $1 A |grep -E "^${1}."|grep -Eo "[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+")
for ip in $ip_list
do
check=$(echo -n $(echo "123" | openssl s_client -connect ${ip}:443 2>/dev/null |grep "issuer=/C=RU/ST=Moscow/O="|wc -l))
if [ $check -eq 1 ]
then
echo $ip
fi
done
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment