Yes, your query strings will be encrypted.
The reason behind is that query strings are part of the HTTPHTTP protocol which is an application layer protocol, while the security (SSL/TLS)(SSL/TLS) part comes from the transport layer. The SSLSSL connection is established first and then the query parameters (which belongsbelong to the httpHTTP protocol) are sent to the server.
When establishing a SSLan SSL connection, your client will callperform the following steps in order. Suppose you're trying to loginlog in to a site named example.com and want to send your credentials using query params parameters. Your complete URLURL may look like the following.:
(e.g https://example.com/login?username=alice&password=12345)
- Your client (e.g:., browser/mobile app) will first resolve your domain name
(example.com)to anIPIP address(124.21.12.31)using aDNSDNS request. When querying that information, only domain specific information is used, i. ie:e., onlyexample.comwill be used. - Now, your client will try to connect to the server with the
IPIP address124.21.12.31and will attempt to connect to port443443 (SSLSSL service port not the defaulthttpHTTP port8080). - Now, the server at
example.comwill send its certificates to your client. - Your client will verify the certificates and start exchanging a shared secret key for your session.
- After successfully establishing a secure connection, then only then will your query parameters be sent via the secure connection.
Therefore, you won't expose sensitive data. However, sending your credentials over an httpsHTTPS session using this method is not the best way. You should go for a different approach.