You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by gm...@apache.org on 2016/06/23 18:01:13 UTC
qpid-dispatch git commit: NO-JIRA - Added a script that uses openssl
to create a root CA and server and client certificates
Repository: qpid-dispatch
Updated Branches:
refs/heads/master 4ba68bb80 -> a5d80887a
NO-JIRA - Added a script that uses openssl to create a root CA and server and client certificates
Project: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/commit/a5d80887
Tree: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/tree/a5d80887
Diff: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/diff/a5d80887
Branch: refs/heads/master
Commit: a5d80887ad5957404f5cf3ff1b098c4b17a10bd2
Parents: 4ba68bb
Author: Ganesh Murthy <gm...@redhat.com>
Authored: Thu Jun 23 14:00:57 2016 -0400
Committer: Ganesh Murthy <gm...@redhat.com>
Committed: Thu Jun 23 14:00:57 2016 -0400
----------------------------------------------------------------------
tests/ssl_certs/gencerts_openssl.sh | 33 ++++++++++++++++++++++++++++++++
1 file changed, 33 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/a5d80887/tests/ssl_certs/gencerts_openssl.sh
----------------------------------------------------------------------
diff --git a/tests/ssl_certs/gencerts_openssl.sh b/tests/ssl_certs/gencerts_openssl.sh
new file mode 100755
index 0000000..2b20c93
--- /dev/null
+++ b/tests/ssl_certs/gencerts_openssl.sh
@@ -0,0 +1,33 @@
+#!/bin/bash -ex
+
+# Creates a root CA and creates password protected server and client certificates using openssl commands
+
+##### Create root CA #####
+# Create a password protected private key for root CA
+openssl genrsa -aes256 -passout pass:ca-password -out ca-private-key.pem 4096
+
+# Use the private key to create a root CA cert
+openssl req -key ca-private-key.pem -new -x509 -days 99999 -sha256 -out ca-certificate.pem -passin pass:ca-password -subj "/C=US/ST=New York/L=Brooklyn/O=Trust Me Inc./CN=Trusted.CA.com"
+
+##### Create a server certificate signed by the root CA #####
+# Create a password protected server private key which will be used to create the server certificate
+openssl genrsa -aes256 -passout pass:server-password -out server-private-key.pem 4096
+
+# Create a CSR using the private key created from the previous step
+openssl req -new -key server-private-key.pem -passin pass:server-password -out server.csr -subj "/C=US/ST=CA/L=San Francisco/O=Server/CN=127.0.0.1"
+
+# Now the CSR has been created and must be sent to the CA.
+# The root CA receives the CSR and runs this command to create a server certificate (server-certificate.pem)
+openssl x509 -req -in server.csr -CA ca-certificate.pem -CAkey ca-private-key.pem -CAcreateserial -days 9999 -out server-certificate.pem -passin pass:ca-password
+
+
+##### Create a client certificate signed by the root CA #####
+# Create a password protected client private key which will be used to create the client certificate
+openssl genrsa -aes256 -passout pass:client-password -out client-private-key.pem 4096
+
+# Create a CSR using the client private key created from the previous step
+openssl req -new -key client-private-key.pem -passin pass:client-password -out client.csr -subj "/C=US/ST=CA/L=San Francisco/O=Client/CN=127.0.0.1"
+
+# Now the CSR has been created and must be sent to the CA.
+# The root CA receives the CSR and runs this command to create a client certificate (client_certificate.pem)
+openssl x509 -req -in client.csr -CA ca-certificate.pem -CAkey ca-private-key.pem -CAcreateserial -days 9999 -out client-certificate.pem -passin pass:ca-password
\ No newline at end of file
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org