a little more explaination is ssl server has private/public key pair, any data encrypted by public key can be only decrypted by private key ( vice versa) ; public key is public to every body as part of the server certificate, private key is only known by the server.
your client access a server, get the public key and verify the certificate, generate a random key, encrypt it by public key, then send it to server; server decrypt it by private key to get the random key, then encrypt any data sent to you by the random key.
if you need to fully understand how ssl work ( I don't either ), you need to read ssl document.
your client access a server, get the public key and verify the certificate, generate a random key, encrypt it by public key, then send it to server; server decrypt it by private key to get the random key, then encrypt any data sent to you by the random key.
if you need to fully understand how ssl work ( I don't either ), you need to read ssl document.