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")
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")
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.
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.