SSL Self-Signed Certificate Authentication Through API Call

Answered

Comments

3 comments

  • Avatar
    Sergey Bystrov

    Rhaphiel Molinar did you figure it out? or do you still need help?

    1
    Comment actions Permalink
  • Avatar
    Rhaphiel Molinar

    Oh wow, I was working on other projects semi-related to this and forgot that I even posted this.  I almost accidentally posted the same thing a couple of days ago.  I think this can potentially help down the line, but its less so that I need to create a new self-signed SSL but instead have my script communicate with the existing default.pem certificate within Spectrum.

     

    Ideally, I want the script to be able to authenticate using the existing resources on the server (since this script is intended to be ran on the server).

    I want the requests.get command that I have to verify with the existing certificate.  I've found documentation online that *generally* explains how to verify the certificate.

     

    In trying to do so, I have it pointing the authentication to the default.pem certificate but it still fails.  Should this be pointing elsewhere?

     

    Example:

    import requests

    import urllib3

    import os

    import ssl

    ca = ('C:\\Windows\\System32\\config\\systemprofile\\AppData\\Local\\Digital Watchdog\\Digital Watchdog Media Server\\ssl\\default.pem')

    requests.get("http://127.0.0.1:7001/rest/v2/servers/this/info?_with=id", auth=basic, verify=ca)

    Basically, I don't want it to have to create a new cert for reference if I don't have to, I want it to try to utilize the existing certificates that are already on the server (either under C:\Windows\System32\config\systemprofile\AppData\Local\Digital Watchdog\Digital Watchdog Media Server\ssl or /opt/digitalwatchdog/mediaserver/var/ssl)

    Has this been done/can it be done?

    0
    Comment actions Permalink

Please sign in to leave a comment.