fb_pixel

Check HTTP connectivity and TLS certs - Python

Development | Programming languages
Price
5.00 €
Money-Back Guarantee
Description
#!/usr/bin/python
from requests import get
from argparse import ArgumentParser
from os.path import exists
from checktls import check_cert

def __get_args():
    parser = ArgumentParser(description='Check HTTP connectivity and TLS certs')
    parser.add_argument('url', help='URL to hit')
    parser.add_argument('output', help='path to output file')
    args = parser.parse_args()
    return args

def __get_data(url):
    resp = get(url)
    http_code = resp.status_code
    response_time = resp.elapsed.microseconds / 1000000.
    base_host = resp.request.url[:-len(resp.request.path_url)]
    if base_host.startswith('http'):
        base_host = base_host.split('/')[-1]
    error, days_left = check_cert(base_host)
    is_ok = error == 0
Attachments
No attachments
Info
You must log in or purchase one of our profile products to access.
All coments
This job has not been commented yet.