SSL communication starts with a handshake
phase, during which a public-crypto-key
is being send to client for future use. So you don't have to have it, your client will get it anyway.
Then why do we need these Public SSL certificate
?
Public SSL certificate
does include public-crypto-key
so you actually can compare the public-crypto-key
coming from the server with public-crypto-key
from your Public SSL certificate
. This does not really make sense by itself unless you also want to check if this public-crypto-key
was issued by some specific Certificate Authority (CA)
.
Anyway, why do we need to check if this public-crypto-key
was issued by some specific Certificate Authority (CA)
? And you really don't care about it when you connect your MYSQL server to your DB client by IP. Because you know an IP of your MySQL server and you already do trust it.
Certificate Authority (CA)
is a kind of legacy
coming from another use of SSL secured protocols known HTTPS
. In HTTPS
you connect to unknown IP address, but there is one thing you should be sure about - a domain name
. The domain names can be reassigned to a new IP addresses every minute. And it can be reassigned to your own localhost (via configuration of the 'hosts' file). Just imagines a sophisticated computer virus that comes to your computer, deploys a web server and reassign your "your-bank.com" web domain to that web server. Next time you open your browser, you enter your bank account credentials, but instead of giving you access to your bank account the web server sends your credentials to hackers. It would be upsetting, right? To avoid this scenario people invented HTTPS
.
In HTTPS your browser doing some checks for you. It requires a public-crypto-key
from a web server just to compare it with a list of known Public SSL certificates
from trusted Certificate Authority (CA)
. Then it checks the domain name assigned to this Public SSL certificates
and establishes if this web server indeed allowed to serve content for the provided domain.
But then, why our "sophisticated virus" cannot parse a handshake
and extract a public-crypto-key
from the real web site just to give it to your browser?
The answer is - "it can". And it can allow HTTPS
authorisation to pass, but then the fraudulent web server would need to "talk" to your browser. And to be able to "talk" the fraudulent web server would need to use private-crypto-key
to encrypt a server messages, but private-crypto-key
is difficult to achieve.
See, we won.
The end.
Except for one thing, AWS uses domain names to access RDS, not the IP addresses. So we do need Public SSL certificates
. But MySQL_Workbench is not a web browser so, you would think, it probably doesn't know much about Certificate Authorities
. But in reality MySQL_Workbench does know about Certificate Authority (CA)
and to activate it you need to go to "SSL" tab and set "Use SSL" drop down list to "Require and Verify CA" - in this case your would need to provide your.pem
file to "SSL CA File:" field.
Back to your question: "why the client reports that the connection is SSL encrypted when I provided no certificate?"
Because it is encrypted with some certificate and it is up to your client to either go with the certificate provided by MySQL server or to verify CA and maybe reject it. Now you tell me, why have you setup your DB client to accept any certificates from the MySQL server bypassing the verification of CA?