Rebnoob
Rebnoob

Reputation: 133

What does an HTTPS request look like?

What additional changes are required to make this simple HTTP header to speak to a HTTPS enabled server.

GET /index.php HTTP/1.1
Host: localhost
[CR]
[CR]

EDIT
To add some context, all I'm trying to do is open a TCP port (443) and read the index page but the server seems to return a 400 - Bad request along with a message that goes "You're speaking plain HTTP to an SSL-enabled server port." I thought this probably meant altering the header in some fashion.

Upvotes: 9

Views: 8070

Answers (2)

Gregory A Beamer
Gregory A Beamer

Reputation: 17010

You encrypt the payload with the information from the server to encrypt. This is done via handshake on a server by server basis, so you can't just fake it once have it work everywhere.

The payload includes the query string, cookies, form, etc.

Upvotes: 4

HTTP runs on top of secured channel. No adjustments are needed at all on HTTP level. You need to encrypt the whole traffic going to the socket (after it leaves HTTP client code) and decrypt the traffic coming from the socket before it reaches HTTP client.

Upvotes: 5

Related Questions