-1

Whenever I run my HTTP client it gives me SSL error

import http.client
conn = http.client.HTTPSConnection("localhost, 8000)
conn.request("GET","/Test File.txt")
TrebledJ
  • 8,713
  • 7
  • 26
  • 48

2 Answers2

1

I guess your localhost isn't configured with HTTPS. You can resolve this by using HTTPConnection client.

Try this:

import http.client
conn = http.client.HTTPConnection("localhost, 8000)
conn.request("GET","/Test File.txt")

If you would like to set up HTTPS on your localhost, you can see this Stackoverflow Question.

Vikas Yadav
  • 3,094
  • 2
  • 20
  • 21
0

You are using a HTTPSConnection HTTP ->S<- Connection (notice the S in the class identifier) which is a SSL connection. Is the localhost:8000 a SSL certified server? If not you might either want to use HTTPConnection instead or make sure your configure your server as an SSL server.

andreihondrari
  • 5,743
  • 5
  • 30
  • 59