-
Notifications
You must be signed in to change notification settings - Fork 57
ci: Use the certificate generation steps from the dev guide #4691
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
mkundu1
wants to merge
4
commits into
main
Choose a base branch
from
feat/generate-certs
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
b9aaffc
ci: Use the certificate generation steps from the dev guide
mkundu1 94635db
chore: adding changelog file 4691.maintenance.md [dependabot-skip]
pyansys-ci-bot d37842b
Update .ci/generate_certs.sh
mkundu1 93eb69c
feat: fix certs generation
mkundu1 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| #!/bin/bash | ||
|
|
||
| set -e | ||
|
|
||
| # Create certs directory | ||
| mkdir -p certs | ||
| pushd certs > /dev/null | ||
|
|
||
| # Generate private key for CA | ||
| openssl genrsa -out ca.key 4096 | ||
|
|
||
| # Generate self-signed CA certificate | ||
| openssl req -x509 -new -nodes -key ca.key -sha256 -days 200 -out ca.crt \ | ||
| -subj "/CN=MyRootCA" | ||
mkundu1 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| # Generate server private key | ||
| openssl genrsa -out server.key 4096 | ||
|
|
||
| # Generate a certificate signing request (CSR) for the server | ||
| openssl req -new -key server.key -out server.csr \ | ||
| -subj "/CN=localhost" | ||
|
|
||
| # Generate server certificate signed by the CA | ||
| openssl x509 -req -in server.csr -CA ca.crt -CAkey ca.key -CAcreateserial \ | ||
| -out server.crt -days 3650 -sha256 -extfile ../.ci/server_ext.cnf -extensions v3_req | ||
|
|
||
| # Generate client private key | ||
| openssl genrsa -out client.key 4096 | ||
|
|
||
| # Generate a certificate signing request (CSR) for the client | ||
| openssl req -new -key client.key -out client.csr \ | ||
| -subj "/CN=grpc-client" | ||
|
|
||
| # Generate client certificate signed by the CA | ||
| openssl x509 -req -in client.csr -CA ca.crt -CAkey ca.key -CAcreateserial \ | ||
| -out client.crt -days 200 -sha256 | ||
mkundu1 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| # Verify server certificate | ||
| openssl verify -CAfile ca.crt server.crt | ||
|
|
||
| # Verify client certificate | ||
| openssl verify -CAfile ca.crt client.crt | ||
|
|
||
| popd > /dev/null | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| [ v3_req ] | ||
| keyUsage = critical, digitalSignature, keyEncipherment | ||
| extendedKeyUsage = serverAuth | ||
| subjectAltName = @alt_names | ||
|
|
||
| [ alt_names ] | ||
| DNS.1 = localhost | ||
| IP.1 = 127.0.0.1 | ||
| IP.2 = ::1 | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Use the certificate generation steps from the dev guide |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.