Skip to content

Commit

Permalink
fix cert generation and added check for CA
Browse files Browse the repository at this point in the history
  • Loading branch information
MatusKysel committed Apr 2, 2024
1 parent a809f68 commit 5a5891b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion entry-point.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ if [ "$1" = "start-operator" ]; then
echo "Certificate or key file not found. Generating new SSL certificate and key."
openssl req -x509 -newkey rsa:4096 -sha256 -days 3650 -nodes \
-keyout "$KEY_FILE" -out "$CERT_FILE" \
-subj "/C=IL/ST=Tel Aviv/L=Tel Aviv/O=Coin-Dash Ltd/CN=*.ssvlabs.io"
-subj "/CN=localhost"
else
echo "Existing SSL certificate and key found. Using them."
fi
Expand Down
2 changes: 1 addition & 1 deletion examples/generate_certs.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

openssl genrsa -out ./initiator/rootCA.key 4096
openssl req -x509 -new -key ./initiator/rootCA.key -subj "/C=IL/ST=Tel Aviv/L=Tel Aviv/O=Coin-Dash Ltd/CN=*.ssvlabs.io" -days 3650 -out ./initiator/rootCA.crt
openssl req -x509 -new -key ./initiator/rootCA.key -subj "/CN=localhost" -days 3650 -out ./initiator/rootCA.crt


for i in $(seq 1 8);
Expand Down
4 changes: 3 additions & 1 deletion pkgs/initiator/initiator.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,9 @@ func GenerateAggregatesKeyshares(keySharesArr []*wire.KeySharesCLI) (*wire.KeySh
func New(operators wire.OperatorsCLI, logger *zap.Logger, ver string, certs []string) (*Initiator, error) {
client := req.C()
// set CA certificates if any
client.SetRootCertsFromFile(certs...)
if len(certs) > 0 {
client.SetRootCertsFromFile(certs...)
}
client.SetTLSClientConfig(&tls.Config{InsecureSkipVerify: true})
// Set timeout for operator responses
client.SetTimeout(30 * time.Second)
Expand Down

0 comments on commit 5a5891b

Please sign in to comment.