-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* 383: Create script to generate certificates for TLS secured connection. * 383: GRPC secured by TLS x509 certificates. * 383: Use inner context in gossip.
- Loading branch information
Showing
26 changed files
with
269 additions
and
48 deletions.
There are no files selected for viewing
This file contains 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 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
Binary file not shown.
This file contains 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,69 @@ | ||
#!/bin/bash | ||
|
||
# Create the server CA certs. | ||
openssl req -x509 \ | ||
-newkey rsa:4096 \ | ||
-nodes \ | ||
-days 3650 \ | ||
-keyout ca_key.pem \ | ||
-out ca_cert.pem \ | ||
-subj /C=US/ST=CA/L=SVL/O=gRPC/CN=test-server_ca/ \ | ||
-config ./openssl.cnf \ | ||
-extensions test_ca \ | ||
-sha256 | ||
|
||
# Create the client CA certs. | ||
openssl req -x509 \ | ||
-newkey rsa:4096 \ | ||
-nodes \ | ||
-days 3650 \ | ||
-keyout client_ca_key.pem \ | ||
-out client_ca_cert.pem \ | ||
-subj /C=US/ST=CA/L=SVL/O=gRPC/CN=test-client_ca/ \ | ||
-config ./openssl.cnf \ | ||
-extensions test_ca \ | ||
-sha256 | ||
|
||
# Generate a server cert. | ||
openssl genrsa -out server_key.pem 4096 | ||
openssl req -new \ | ||
-key server_key.pem \ | ||
-days 3650 \ | ||
-out server_csr.pem \ | ||
-subj /C=US/ST=CA/L=SVL/O=gRPC/CN=test-server1/ \ | ||
-config ./openssl.cnf \ | ||
-reqexts test_server | ||
openssl x509 -req \ | ||
-in server_csr.pem \ | ||
-CAkey ca_key.pem \ | ||
-CA ca_cert.pem \ | ||
-days 3650 \ | ||
-set_serial 1000 \ | ||
-out server_cert.pem \ | ||
-extfile ./openssl.cnf \ | ||
-extensions test_server \ | ||
-sha256 | ||
openssl verify -verbose -CAfile ca_cert.pem server_cert.pem | ||
|
||
# Generate a client cert. | ||
openssl genrsa -out client_key.pem 4096 | ||
openssl req -new \ | ||
-key client_key.pem \ | ||
-days 3650 \ | ||
-out client_csr.pem \ | ||
-subj /C=US/ST=CA/L=SVL/O=gRPC/CN=test-client1/ \ | ||
-config ./openssl.cnf \ | ||
-reqexts test_client | ||
openssl x509 -req \ | ||
-in client_csr.pem \ | ||
-CAkey client_ca_key.pem \ | ||
-CA client_ca_cert.pem \ | ||
-days 3650 \ | ||
-set_serial 1000 \ | ||
-out client_cert.pem \ | ||
-extfile ./openssl.cnf \ | ||
-extensions test_client \ | ||
-sha256 | ||
openssl verify -verbose -CAfile client_ca_cert.pem client_cert.pem | ||
|
||
rm *_csr.pem |
This file contains 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,28 @@ | ||
[req] | ||
distinguished_name = req_distinguished_name | ||
attributes = req_attributes | ||
|
||
[req_distinguished_name] | ||
|
||
[req_attributes] | ||
|
||
[test_ca] | ||
basicConstraints = critical,CA:TRUE | ||
subjectKeyIdentifier = hash | ||
authorityKeyIdentifier = keyid:always,issuer:always | ||
keyUsage = critical,keyCertSign | ||
|
||
[test_server] | ||
basicConstraints = critical,CA:FALSE | ||
subjectKeyIdentifier = hash | ||
keyUsage = critical,digitalSignature,keyEncipherment,keyAgreement | ||
subjectAltName = @server_alt_names | ||
|
||
[server_alt_names] | ||
DNS.1 = * | ||
|
||
[test_client] | ||
basicConstraints = critical,CA:FALSE | ||
subjectKeyIdentifier = hash | ||
keyUsage = critical,nonRepudiation,digitalSignature,keyEncipherment | ||
extendedKeyUsage = critical,clientAuth |
This file contains 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 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,43 @@ | ||
is_profiling: false | ||
notary_server: | ||
public_url: localhost:8001 | ||
port: 8001 | ||
data_size_bytes: 15000 | ||
certificate: "./certificates/server_cert.pem" | ||
key: "./certificates/server_key.pem" | ||
gossip_server: | ||
url: localhost:8081 | ||
genesis_url: localhost:8080 | ||
load_dag_url: localhost:8080 | ||
genesis_receiver: | ||
genesis_spice: | ||
currency: | ||
supplementary_currency: | ||
vertices_db_path: | ||
port: 8081 | ||
certificate: "./certificates/server_cert.pem" | ||
key: "./certificates/server_key.pem" | ||
ca_cert: "./certificates/ca_cert.pem" | ||
accountant: | ||
trusted_nodes_db_path: | ||
tokens_db_path: | ||
trxs_to_vertices_map_db_path: | ||
vertices_db_path: | ||
truncate_at_weight: 0 | ||
nats: | ||
server_address: | ||
client_name: "notary-dependant" | ||
token: "D9pHfuiEQPXtqPqPdyxozi8kU2FlHqC0FlSRIzpwDI0=" | ||
dataprovider: | ||
longevity: 300 | ||
file_operator: | ||
wallet_path: "artefacts/wallet_notary_one" | ||
wallet_passwd: "ce6c5f7da2b791befa726cebe1df78d7d01439a8292d26e116e894cb75f49e2e" | ||
pem_path: "" | ||
ca_cert: "./certificates/ca_cert.pem" | ||
webhooks_server: | ||
port: 8000 | ||
zinc_logger: | ||
address: | ||
index: genesis | ||
token: Basic YWRtaW46emluY3NlYXJjaA== |
This file contains 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
File renamed without changes.
File renamed without changes.
This file contains 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 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.