Note that there are some explanatory texts on larger screens.

plurals
  1. POWhat does it take to convert an http server into an https server?
    primarykey
    data
    text
    <p>This question is similar to <a href="https://stackoverflow.com/questions/3215318/starting-to-use-openssl">Starting to use OpenSSL</a> but more specific and detailed so I think it's fair to ask.</p> <p>Suppose I have an simple http server that does the following in a successful GET scenario </p> <ul> <li>creates a listening socket</li> <li>a client connects</li> <li>reads the data through recv</li> <li>parses the GET request, now it knows which resource to return</li> <li>writes the response through send</li> <li>close the socket</li> </ul> <p>This server is written in c++ on linux.</p> <p>My question is, What does it take to convert this server into an minimal https server? (in particular using OpenSSL, but answers in a general sense are welcome.)</p> <p>Here's my understanding (question marks mean I'm have no idea)</p> <ul> <li>initialize the library</li> <li>read the server certificate and private key and other configurations</li> <li>create a normal listening socket(?)</li> <li>a client connects</li> <li>do the handshaking through a library function(?)</li> <li>handshaking done</li> <li>do I need a special step before I start receiving and sending data?</li> <li>read data through library function(?)</li> <li>does the data look exactly like an HTTP GET at this point?</li> <li>if it does, parse the GET and get the resource</li> <li>write return data through library function(?)</li> <li>close the connection through a library function(?)</li> </ul> <p>In summary, I'm hoping that it only requires adding some extra steps to the current code and does not affect the HTTP parsing. Is this assumption correct?</p> <p>Many thanks to anybody who could fill in the blanks.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload