<p>I'm developing a client/server app that will communicate via rest. Some custom request data will be stored in the header of the request. Both the server sending the request and the receiving server have an SSL certificate - will the headers be encrypted, or just the content?</p>

[{'answer_id': 73561, 'author': 'Ori Pessach', 'author_id': 9047, 'author_profile': 'https://Stackoverflow.com/users/9047', 'pm_score': 7, 'selected': True, 'text': "<p>SSL encrypts the entire communications path from the client to the server and back, so yes - the headers will be encrypted.</p>\n\n<p>By the way, if you develop networked applications and care about data security, the least you should do is read a book like Practical Cryptography, by Niels Ferguson and Bruce Schneier, and probably further reading that's more focused on web application security would be a good idea. If I may make an observation - and please, I don't mean that as a personal criticism - your question indicates a fundamental lack of understanding of very basic web security technologies, and that's never a good sign.</p>\n\n<p>Also, it's never a bad idea to confirm that data which is assumed to be encrypted is indeed encrypted. You can use a network analyzer to monitor traffic on the wire and watch out for anything sensitive being sent in the clear. I've used Wireshark to do this before - the results can be surprising, sometimes.</p>\n"}, {'answer_id': 73572, 'author': 'cjm', 'author_id': 8355, 'author_profile': 'https://Stackoverflow.com/users/8355', 'pm_score': 3, 'selected': False, 'text': '<p>Both headers and content are encrypted.</p>\n'}, {'answer_id': 73574, 'author': 'Community', 'author_id': -1, 'author_profile': 'https://Stackoverflow.com/users/-1', 'pm_score': 0, 'selected': False, 'text': "<p>SSL..or rather HTTPS (HTTP over SSL) sends all HTTP content over SSL, and as HTTP content and headers are in fact the same thing, this means the headers are encrypted as well.\nSeeing as GET and POST data is sent via HTTP headers, then it only makes sense then when sending data securely you wouldn't just want the response code or content to be encrypted.</p>\n"}, {'answer_id': 73575, 'author': 'zigdon', 'author_id': 4913, 'author_profile': 'https://Stackoverflow.com/users/4913', 'pm_score': 3, 'selected': False, 'text': "<p>As long as you're communicating in the SSL tunnel, everything sent between the server and the client will be encrypted.  The encryption is done before any data is sent or received.</p>\n"}, {'answer_id': 73635, 'author': 'Vinko Vrsalovic', 'author_id': 5190, 'author_profile': 'https://Stackoverflow.com/users/5190', 'pm_score': 2, 'selected': False, 'text': '<p>Having a certificate is not enough, you have to configure the web server to encrypt the connections (that is, to use the certificate) for that domain or virtual host. In addition, I think you would just need a single certificate, responses to requests will still be encrypted.</p>\n\n<p>And yes, HTTP headers are encrypted as well as the data.</p>\n'}, {'answer_id': 73722, 'author': 'ddaa', 'author_id': 11549, 'author_profile': 'https://Stackoverflow.com/users/11549', 'pm_score': 2, 'selected': False, 'text': '<p>You appear to think that REST is a distinct protocol.</p>\n\n<p>REST is not a protocol. It is a design style for HTTP-based applications.</p>\n\n<p>So, your a writing an HTTP application. Are the headers encrypted? Yes, if you are using the HTTPS (HTTP over SSL) protocol instead of plain HTTP.</p>\n\n<p>Having certificates on both sides is not directly relevant to your question. SSL certificates are used for authentication. They help in detecting man-in-the-middle attacks such as are possible using DNS cache poisoning.</p>\n'}, {'answer_id': 93089, 'author': 'Avi Flax', 'author_id': 7012, 'author_profile': 'https://Stackoverflow.com/users/7012', 'pm_score': 1, 'selected': False, 'text': '<p>The other answers are correct that headers are indeed encrypted, along with the body, when using SSL. But keep in mind that the URL, which can include query parameters, is <strong>never</strong> encrypted. So be careful to never put any sensitive information in URL query parameters.</p>\n\n<p><strong>Update:</strong> as @blowdart pointed out below, this is wrong. See the comment below.</p>\n'}, {'answer_id': 10306223, 'author': 'Jacob Toronto', 'author_id': 1354778, 'author_profile': 'https://Stackoverflow.com/users/1354778', 'pm_score': -1, 'selected': False, 'text': '<p>Not <em>everything</em> is encrypted: the request query string is not encrypted.  Believe me, I\'ve seen requests like this:</p>\n\n<p><a href="https://mydomain.com/authenticate?user=username&amp;password=MyStrongPasswordSentInTheClear" rel="nofollow">https://mydomain.com/authenticate?user=username&amp;password=MyStrongPasswordSentInTheClear</a></p>\n\n<p>Please don\'t put sensitive data as parameters in the query string.</p>\n'}]
['https://Stackoverflow.com/questions/73536', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/12280/']