Hi all,
I'm currently working on accessing AXIS API calls through the scripting console which works fine if I have HTTPS disabled - obviously this is not ideal.
Currently I've followed 3 sets of instructions - 2 from Ignition and 1 from AXIS - and now cannot seem to get them to link properly.
Instructions:
https://docs.inductiveautomation.com/display/DOC81/Security+Certificates
I generated the AXIS root certificate and placed it in the correct location per the instructions on the first and third links.
Additionally I enabled SSL via a self-signed certificate on the gateway web-page. The camera ports have been linked to the defaults on the SSL page but will be changed later when I get this working.
I am certain this link can be made, I'm just uncertain as to how to proceed to make this link acceptable to Ignition.
Any insight is greatly appreciated.
Thank you,
Cam
I'm not sure enabling SSL for Ignition is relevant here.
You added the AXIS root CA to the supplemental certificates, which is good, but are you making/testing your API calls from gateway scope or are you testing in a Client/Designer? Did you restart the Gateway since then?
Ohh, I thought I would need to enable SSL.
I'm testing the API calls from the Client/Designer. I have restarted my gateway and all that good stuff.
You'll have to add the certificates to your Client/Designer machine too: Launcher Settings - Ignition User Manual 8.1 - Ignition Documentation
Or execute the script from the gateway scope instead.
It has been added and I restarted my designer but still no dice.
...
urllib2.URLError: <urlopen error [Errno 1] certificate verify failed (java.security.cert.CertificateException: certificate verify failed)>
Can you share that certificate here?
I also have no idea if the default Java keystore is used when you use the Jython stdlib urrlib functions instead of Ignition's.
It wont accept an upload into the post :(. If you let me know more or less what you're looking for I can take a picture of it for you.
Me neither but it was the only option I could make work because the httpClient only accepts basic authentication not digest and AXIS communication is all via digest from what I understand. Can you access AXIS PTZ controls via Ignition? - #8 by bmusson
Maybe try something like this just to see if it works:
import urllib2
import ssl
ctx = ssl.create_default_context()
ctx.check_hostname = False
ctx.verify_mode = ssl.CERT_NONE
urllib2.urlopen("https://blahblahblahl", context=ctx)
import urllib2
import ssl
ctx = ssl.create_default_context()
ctx.check_hostname = False
ctx.verify_mode = ssl.CERT_NONE
url = "https://<--myserver-->/axis-cgi/com/ptz.cgi?zoom=1000" #<--myserver--> is just a placeholder im using
password = urllib2.HTTPPasswordMgrWithDefaultRealm()
password.add_password(None, url, "***", "***") # *** is also just a place holder im using
handler = urllib2.HTTPDigestAuthHandler(password)
opener = urllib2.build_opener(handler)
response = opener.open(url)
I slightly modified the script I was running but I'm not sure where to put the "context = ctx"
Was this ever figured out?