Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
d5276f71
Commit
d5276f71
authored
May 03, 2006
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update NOTES with information how we generate new keys
parent
bd0794bc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
62 additions
and
0 deletions
+62
-0
SSL/NOTES
SSL/NOTES
+62
-0
No files found.
SSL/NOTES
View file @
d5276f71
...
...
@@ -40,7 +40,69 @@ openssl s_server -port 1111 -cert ../SSL/server-cert.pem -key ../SSL/server-key.
-------------------------------------------
How to generate new keys:
First we need the private key of the CA cert. Since we always throw
away the old private key for the CA, we need to generate a totally new
CA cert. Our CA cert is self signed and we will use that to sign the
server and client keys. As long as we distibute the cacert.pem they can
b oth be validated against that.
1) openssl genrsa 512 > cecert.pem
2) openssl req -new -x509 -nodes -md5 -days 1000 -key cacert.pem > cacert.pem
We now have a cacert.pem which is the public key and a cakey.pem which is the
private key of the CA.
Steps to generate the server key.
3) openssl req -newkey rsa:512 -md5 -days 1000 -nodes -keyout server-key.pem > server-req.pem
4) copy ca-key.pem ca-cert.srl
5) openssl x509 -req -in server-req.pem -days 1000 -md5 -CA ca-cert.pem -CAkey ca-key.pem -set_serial 01 > server-cert.pem
-- adding metadata to beginning
6) openssl x509 -in server-cert.pem -text > tmp.pem
7) mv tmp.pem server-cert.pem
-- And almost the same for the client.
8) openssl req -newkey rsa:512 -md5 -days 1000 -nodes -keyout client-key.pem > client-req.pem
9) openssl x509 -req -in client-req.pem -days 1000 -md5 -CA ca-cert.pem -CAkey ca-key.pem -set_serial 01 > client-cert.pem
-- adding metadata to beginning
10) openssl x509 -in client-cert.pem -text > tmp.pem
11) mv tmp.pem client-cert.pem
The new certs are now generated. They can be verified against the cacert to test they are ok. This is actually what is done in the MySQL client and server.
12) openssl verify -CAfile cacert.pem server-cert.pem
server-cert.pem: OK
13) openssl verify -CAfile cacert.pem client-cert.pm
client-cert.pem: OK
The files we add to our repository and thus distribute are
* cacert.pem - CA's public key, used to verify the client/servers pblic keys
* server-key.pem - servers private key
* server-cert.pem - servers public key
* client-key.pem - clients private key
* client-cert.pem - clients public key
== OLD NOTES below ==
--------------------------------------------
CA stuff:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment