Reputation: 55
I'm playing around with openssl s_client and a webserver and I wonder why I'm losing the connection to the server after each GET request I send:
Handshake works fine:
openssl s_client -connect hostname:port
GET / HTTP/1.1
Host: hostname
Connection: keep-alive
Then I receive the response from the application server: HTTP/1.1 200 OK
...more http here...
<html/>closed
As you see the connection is closed, but as I used the connection header with keep-alive, isn't the connection supposed to stay established? I want to test the renegotiation feature of SSL and therefor I need to be able to keep the session alive between several requests.
Upvotes: 2
Views: 5039
Reputation: 5079
Your server must reply with a Connection: Keep-Alive
header as well to establish a keepalive connection.
Change your server side configuration to do this.
But be aware of the performace issues coming with keepalive connection as well as the fact that many browsers close the connection after a certain timeout.
Upvotes: 2