bashrc & zshrc: clone & break serversslcertfp

serversslcertfp now has comments and there are separate functions for
md5, sha1 and sha256.
This commit is contained in:
Mikaela Suomalainen 2014-12-21 15:46:11 +02:00
parent 4cf47c1c6a
commit ae47a222e6
2 changed files with 38 additions and 0 deletions

19
bashrc
View File

@ -841,12 +841,31 @@ github-add-pulls() {
git config --add remote.upstream.fetch '+refs/pull/*/head:refs/remotes/upstream/-pr/*'
}
# Get server SSL certificate fingerprint in MD5, SHA1 and SHA256.
# Note that this should not be pointed to round-robin and is pointed
# preferably to direct IP address.
# Note that OpenSSL doesn't support IPv6 at time of writing (2014-12-21).
serversslcertfp() {
openssl s_client -connect $1 < /dev/null 2>/dev/null|openssl x509 -fingerprint -md5 -noout -in /dev/stdin
openssl s_client -connect $1 < /dev/null 2>/dev/null|openssl x509 -fingerprint -sha1 -noout -in /dev/stdin
openssl s_client -connect $1 < /dev/null 2>/dev/null|openssl x509 -fingerprint -sha256 -noout -in /dev/stdin
}
# Get server SSL certificate fingerprint in MD5, SHA1 and SHA256.
serversslcertfpmd5() {
openssl s_client -connect $1 < /dev/null 2>/dev/null|openssl x509 -fingerprint -md5 -noout -in /dev/stdin
}
# Get server SSL certificate fingerprint in MD5, SHA1 and SHA256.
serversslcertfpsha1() {
openssl s_client -connect $1 < /dev/null 2>/dev/null|openssl x509 -fingerprint -sha1 -noout -in /dev/stdin
}
# Get server SSL certificate fingerprint in MD5, SHA1 and SHA256.
serversslcertfpsha256() {
openssl s_client -connect $1 < /dev/null 2>/dev/null|openssl x509 -fingerprint -sha256 -noout -in /dev/stdin
}
# .custom
if [ -f ~/.custom ]; then
source ~/.custom

19
zshrc
View File

@ -819,12 +819,31 @@ github-add-pulls() {
git config --add remote.upstream.fetch '+refs/pull/*/head:refs/remotes/upstream/-pr/*'
}
# Get server SSL certificate fingerprint in MD5, SHA1 and SHA256.
# Note that this should not be pointed to round-robin and is pointed
# preferably to direct IP address.
# Note that OpenSSL doesn't support IPv6 at time of writing (2014-12-21).
serversslcertfp() {
openssl s_client -connect $1 < /dev/null 2>/dev/null|openssl x509 -fingerprint -md5 -noout -in /dev/stdin
openssl s_client -connect $1 < /dev/null 2>/dev/null|openssl x509 -fingerprint -sha1 -noout -in /dev/stdin
openssl s_client -connect $1 < /dev/null 2>/dev/null|openssl x509 -fingerprint -sha256 -noout -in /dev/stdin
}
# Get server SSL certificate fingerprint in MD5, SHA1 and SHA256.
serversslcertfpmd5() {
openssl s_client -connect $1 < /dev/null 2>/dev/null|openssl x509 -fingerprint -md5 -noout -in /dev/stdin
}
# Get server SSL certificate fingerprint in MD5, SHA1 and SHA256.
serversslcertfpsha1() {
openssl s_client -connect $1 < /dev/null 2>/dev/null|openssl x509 -fingerprint -sha1 -noout -in /dev/stdin
}
# Get server SSL certificate fingerprint in MD5, SHA1 and SHA256.
serversslcertfpsha256() {
openssl s_client -connect $1 < /dev/null 2>/dev/null|openssl x509 -fingerprint -sha256 -noout -in /dev/stdin
}
# Source files for miscannellious modifications.
# .custom