【发布时间】:2020-02-24 13:44:16
【问题描述】:
要通过 ssl 连接到远程 mysql 服务器,我们需要创建以下密钥
-rwxrwxrwx 1 root root 1.7K Oct 29 15:21 ca-key.pem
-rwxrwxrwx 1 root root 1.3K Oct 29 15:21 ca.pem
-rwxrwxrwx 1 root root 1.2K Oct 29 15:21 client-cert.pem
-rwxrwxrwx 1 root root 1.7K Oct 29 15:21 client-key.pem
-rwxrwxrwx 1 root root 993 Oct 29 15:21 client-req.pem
-rwxrwxrwx 1 root root 1.2K Oct 29 15:21 server-cert.pem
-rwxrwxrwx 1 root root 1.7K Oct 29 15:21 server-key.pem
-rwxrwxrwx 1 root root 993 Oct 29 15:21 server-req.pem
建立安全连接
mysql -u balaji_sri -pXXX --ssl-ca=ca.pem --ssl-key=client-key.pem --ssl-cert=client-cert.pem -h 18.221.222.23
I understand how web ssl works.
(
*servers pub key is encrypted with CA'S private key which is shared to client as ssl key
*browser has all CA'S public key. browser decrypts and gets servers pub key
*client generates a random number and encrypts with servers public key
*server is able to decrypt that with its own private key
*rest of connection is handled with symmetrical encryption with the random number
)
以类似的方式,一些机构可以解释上面提到的每个键的作用是什么。 (ca-key.pem、ca.pem、client-cert.pem、client-key.pem、client-req.pem、server-cert.pem、server-key.pem、server-req.pem)
【问题讨论】: