I have gone through many of the posts including My understanding of how HTTPS works (gmail for example). Everywhere it's mentioning that before creating a https connection, the browser verifies the server's certificate and then uses the server's public key to encrypt data to the server, and server then decrypts using its private key.
But where does this public key come from?
While generating certificates, aren't we generating private key which the server use to decrypt data?
Also, how does the server respond if it has to use the public key for encrypting the reply? How is the browser going to decrypt encrypted reply from server since there is no private key at browser side?