I
I
Ivan2018-06-22 17:36:25
Python
Ivan, 2018-06-22 17:36:25

How to correctly send a GET request through an SSL tunnel in Python?

On a Debian server, a service (JSON-RPS) with a REST API is running.
To connect to the server via SSL
, you need to write GET requests to the service in Python 3.6.
created a tunnel in Putty. localport--> server: the port on which the service is running.
I form a request:

s = requests.Session()
    url = "https://localhost:3704"

   response = s.post(
        url,
        data=json.dumps(rpc_input),
        headers=headers,
        timeout = 5,
        verify=False)

I get an error
requests.exceptions.SSLError: HTTPSConnectionPool(host='localhost', port=3704): Max retries exceeded with url: / (Caused by SSLError(SSLError("bad handshake: SysCallError(10054, 'WSAECONNRESET')",),))

how do i sign the request?
what needs to be done so that the GET request goes to the service?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question