system.net.httpPut() bypassCertValidation is not doing bypass

I’ve been trying to use bypassCertValidation = True in system.net.httpPut(), but I’m not able to reach the responce.

I have this Provider EndPoint with SSL Redirected that is in fact an Ignition Server with Web Service module. Even though I have a self signed cert in that gateway. I’m able to reach the response content via 3rd party software using a similar option to bypassCertValidation = True.

However I’m struggling the reach the response with Ignition System Functions. I have no errors when executing, in fact I’m having a empty string as response. What am I missing?

Script that returns empty string

url = 'http://ip:port/system/ws/rest/endpoint'
contentType = 'application/json'
putData = '{"site":site1}'
print system.net.httpPut(url, contentType, putData, bypassCertValidation = True)

As soon as I change the config to not redirect to SSL, the script works. Remember that the 3rd Party consumer works ok for both, using or not SSL Redirect at the EndPoint.

EDIT:
When using the https and http port got an error:

Traceback (most recent call last):
  File "<input>", line 4, in <module>
IOError: Unsupported or unrecognized SSL message

When using the https and https port got an error as weel:

Traceback (most recent call last):
  File "<input>", line 4, in <module>
IOError: Server returned HTTP response code: 405 for URL: https://localhost:8043/system/ws/rest/remote

Why are you not using httpClient ? It is the solution to numerous limitations in the old httpPut and httpGet functions.

I don’t see any evidence that bypassCertValidation isn’t working.

It seems like when you actually communicate with the endpoint, using https and https port, you get a HTTP 405 indicating that PUT isn’t accepted.

1 Like

Is just for testing. Thanks for the remind that there are new and better functions for this.

You’re right, I’m not sure what I was doing wrong but now is totally working. Thanks for the help