1

My code (generete by postman), through postman works normally, via powershell too.

import requests
url = "https://tamcmdb.tivit.com/mctwpsapi/v1/api/new?"
payload={}
files={}
headers = {}
response = requests.request("POST", url, headers=headers, data=payload, files=files)
print(response.text)

My question is the following, currently the code below works when the POST is done in a dev environment, where the API has the address http://localhost/xpto, however, when used in production, where the address is https, always me returns the error below.

HTTPSConnectionPool(host='tamcmdb.tivit.com', port=443): Max retries exceeded with url: /mctwpsapi/v1/api/new (Caused by SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:1129)')))
During handling of the above exception, another exception occurred:
During handling of the above exception, another exception occurred:
File "D:\DEV\Python\MCT\BBL.py", line 6, in <module> (Current frame)
response = requests.request("POST", url, headers=headers, data=payload, files=files)

I tried with the command verify=False, but it doesn't work, it generates the error below

('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))
During handling of the above exception, another exception occurred:
During handling of the above exception, another exception occurred:
File "D:\DEV\Python\MCT\BBL.py", line 6, in <module> (Current frame)
response = requests.request("POST", url, headers=headers, data=payload, files=files, verify=False)

Help-me

1 Answers1

0

You should check system variable SSLKEYLOGFILE. Path in this should be reachable. Also error appear in python >3.7.