How can we help?


python certificate problem

Comments

1 comment

  • Avatar
    Sam Granger (Edited )

    Hey Geoff,

    I played around this and had some success using the following code (tested on RainMachine Mini-8).

    #!/usr/bin/python
    import requests

    #Disable cert warning
    requests.packages.urllib3.disable_warnings()

    #Set variables
    rm_accesstoken = "xxx-my-access-token-goes-here-xxxx"
    rm_host = "xxx-my-ip-address-xxx"

    # Create request and set cookies
    request_path = ('https://%s:8080/api/4/machine/time' % rm_host)
    rm_cookies = dict(access_token=rm_accesstoken)

    # Request (verify=False disables cert check)
    r = requests.get(request_path, cookies = rm_cookies, verify=False)
    print r.text

    Regards,
    Sam

Please sign in to leave a comment.