GithubHelp home page GithubHelp logo

Comments (7)

petermattis avatar petermattis commented on August 27, 2024

I had to figure out the openssl commands for doing this recently. Might as well copy them here for posterity.

rm -f ca.{key,crt} test.{key,csr,crt}
rm -f index.txt* serial* *.pem

# Generate a self-signed CA.
openssl req -x509 -config openssl.cnf -nodes -days 365 \
    -newkey rsa:1024 -subj "/C=US/ST=New York/L=New York/O=Cockroach/CN=Test CA" \
    -extensions v3_ca -keyout ca.key -out ca.crt

# Create the certificate signing requests.
openssl req -config openssl.cnf -nodes -days 365 \
    -newkey rsa:1024 -subj "/C=US/ST=New York/L=env:development/O=Cockroach/OU=test/CN=localhost" \
    -keyout test.key -out test.csr

# Setup the files needed by the CA.
touch index.txt index.txt.attr
echo "01" > serial

# Generate the client and server certificates from the signing
# requests.
openssl ca -batch -config openssl.cnf -cert ca.crt -keyfile ca.key \
    -extensions good_usr_crt -in test.csr -out test.crt

# Remove the files needed by the CA. These don't need to be checked in
# because we'll just recreate them if this script needs to be re-run.
rm -f index.txt* serial* *.pem *.csr ca.key

from cockroach.

spencerkimball avatar spencerkimball commented on August 27, 2024

Awesome.

On Tue, Jun 3, 2014 at 4:22 PM, Peter Mattis [email protected]
wrote:

I had to figure out the openssl commands for doing this recently. Might as
well copy them here for posterity.

rm -f ca.{key,crt} test.{key,csr,crt}
rm -f index.txt* serial* *.pem
Generate a self-signed CA.

openssl req -x509 -config openssl.cnf -nodes -days 365
-newkey rsa:1024 -subj "/C=US/ST=New York/L=New York/O=Cockroach/CN=Test
CA"
-extensions v3_ca -keyout ca.key -out ca.crt
Create the certificate signing requests.

openssl req -config openssl.cnf -nodes -days 365
-newkey rsa:1024 -subj "/C=US/ST=New
York/L=env:development/O=Cockroach/OU=test/CN=localhost"
-keyout test.key -out test.csr
Setup the files needed by the CA.

touch index.txt index.txt.attr
echo "01" > serial
Generate the client and server certificates from the signing requests.

openssl ca -batch -config openssl.cnf -cert ca.crt -keyfile ca.key
-extensions good_usr_crt -in test.csr -out test.crt
Remove the files needed by the CA. These don't need to be checked in because
we'll just recreate them if this script needs to be re-run.

rm -f index.txt* serial* *.pem *.csr ca.key


Reply to this email directly or view it on GitHub
#21 (comment)
.

from cockroach.

bdarnell avatar bdarnell commented on August 27, 2024

FYI go's crypto libraries include key generation stuff as well, so we might be able to do this without shelling out to openssl. I'm not sure which will turn out to be easier.

from cockroach.

philips avatar philips commented on August 27, 2024

We have a Go based client certificate authority here: https://github.com/coreos/etcd-ca and there is this too: https://github.com/cloudflare/cfssl

from cockroach.

andybons avatar andybons commented on August 27, 2024

Great. Thanks, @philips!

from cockroach.

spencerkimball avatar spencerkimball commented on August 27, 2024

@mberhault is this still under development or ready to be crossed off the list? (I know there's still endless work associated with this, but perhaps that follow on stuff should get new issues).

from cockroach.

mberhault avatar mberhault commented on August 27, 2024

the inter-node part is done. I'll file different issues for client certs (the main chunk of the work left) and key management for nodes.

from cockroach.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.