]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/arrow/testing/data/flight/gen-certs.sh
import quincy 17.2.0
[ceph.git] / ceph / src / arrow / testing / data / flight / gen-certs.sh
diff --git a/ceph/src/arrow/testing/data/flight/gen-certs.sh b/ceph/src/arrow/testing/data/flight/gen-certs.sh
new file mode 100755 (executable)
index 0000000..93e2f77
--- /dev/null
@@ -0,0 +1,25 @@
+#!/bin/bash
+
+set -eux
+
+openssl genrsa -out root-ca.key 4096
+openssl req -x509 -new -nodes \
+        -subj "/C=US/ST=CA/O=MyOrg, Inc./CN=test" \
+        -key root-ca.key -sha256 -days 10000 -out root-ca.pem
+
+openssl genrsa -out cert0.key 4096
+openssl req -new -sha256 -key cert0.key \
+        -subj "/C=US/ST=CA/O=MyOrg, Inc./CN=localhost" \
+        -out cert0.csr
+# Convert to PKCS#1 for Java
+openssl pkcs8 -in cert0.key -topk8 -nocrypt > cert0.pkcs1
+openssl x509 -req -in cert0.csr -CA root-ca.pem -CAkey root-ca.key -CAcreateserial \
+        -out cert0.pem -days 10000 -sha256
+
+openssl genrsa -out cert1.key 4096
+openssl req -new -sha256 -key cert1.key \
+        -subj "/C=US/ST=CA/O=MyOrg, Inc./CN=localhost" \
+        -out cert1.csr
+openssl pkcs8 -in cert1.key -topk8 -nocrypt > cert1.pkcs1
+openssl x509 -req -in cert1.csr -CA root-ca.pem -CAkey root-ca.key -CAcreateserial \
+        -out cert1.pem -days 10000 -sha256