openssl s_client -showcerts -connect google.com:443 </dev/null 2>/dev/null|openssl x509 -outform PEM | python3 -c "
import sys
import json
body = {}
body['cert'] = sys.stdin.read()
json.dump(body, sys.stdout)
" | python3 -c "
import sys
import json
body = json.load(sys.stdin)
print(body['cert'])
" | openssl x509 -text; echo $?
Certificate:
Data:
Version: 3 (0x2)
Serial Number:
fa:bc:89:f7:bf:33:10:94:0a:00:00:00:01:25:fd:32
Signature Algorithm: sha256WithRSAEncryption
...
0