Skip to content

Commit 9b011de

Browse files
committed
[FAB-4886] Add tls_root_certs to MSPConfig etc.
Now add the tls_root_certs field to updated FabricMSPConfig proto structure. Now create intermediate ca certs folder and new tlscacerts folder for local MSP config. Recommented the doNotDecompose option for feature. Change-Id: Ie406b6d74b03314b53f7eb9ee81627e572811ee5 Signed-off-by: Jeff Garratt <[email protected]>
1 parent 69d40c3 commit 9b011de

8 files changed

+93
-23
lines changed

bddtests/features/bootstrap.feature

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Feature: Bootstrap
1616
As a blockchain entrepreneur
1717
I want to bootstrap a new blockchain network
1818

19-
@doNotDecompose
19+
# @doNotDecompose
2020
@generateDocs
2121
Scenario Outline: Bootstrap a development network with 4 peers (2 orgs) and 1 orderer (1 org), each having a single independent root of trust (No fabric-ca, just openssl)
2222
#creates 1 self-signed key/cert pair per orderer organization

bddtests/msp/identities_pb2.py

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bddtests/msp/identities_pb2_grpc.py

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
11
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
22
import grpc
3-
from grpc.framework.common import cardinality
4-
from grpc.framework.interfaces.face import utilities as face_utilities
53

bddtests/msp/msp_config_pb2.py

+79-11
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bddtests/msp/msp_config_pb2_grpc.py

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
11
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
22
import grpc
3-
from grpc.framework.common import cardinality
4-
from grpc.framework.interfaces.face import utilities as face_utilities
53

bddtests/msp/msp_principal_pb2.py

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
11
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
22
import grpc
3-
from grpc.framework.common import cardinality
4-
from grpc.framework.interfaces.face import utilities as face_utilities
53

bddtests/steps/bootstrap_util.py

+9-1
Original file line numberDiff line numberDiff line change
@@ -830,9 +830,10 @@ def getMSPConfig(org, directory):
830830
org.name == nat.organization and "configadmin" in nat.nodeName.lower()]:
831831
adminCerts.append(crypto.dump_certificate(crypto.FILETYPE_PEM, cert))
832832
cacerts = [org.getCertAsPEM()]
833+
tls_root_certs = [org.getCertAsPEM()]
833834
# Currently only 1 component, CN=<orgName>
834835
# name = self.getSelfSignedCert().get_subject().getComponents()[0][1]
835-
fabricMSPConfig = msp_config_pb2.FabricMSPConfig(admins=adminCerts, root_certs=cacerts, name=org.name)
836+
fabricMSPConfig = msp_config_pb2.FabricMSPConfig(admins=adminCerts, root_certs=cacerts, name=org.name, tls_root_certs=tls_root_certs)
836837
mspConfig = msp_config_pb2.MSPConfig(config=fabricMSPConfig.SerializeToString(), type=0)
837838
return mspConfig
838839

@@ -891,7 +892,12 @@ def _writeMspFiles(self, directory , project_name, compose_service, network):
891892
os.makedirs("{0}/{1}".format(localMspConfigPath, "signcerts"))
892893
os.makedirs("{0}/{1}".format(localMspConfigPath, "admincerts"))
893894
os.makedirs("{0}/{1}".format(localMspConfigPath, "cacerts"))
895+
#TODO: Consider how to accomodate intermediate CAs
896+
os.makedirs("{0}/{1}".format(localMspConfigPath, "intermediatecacerts"))
894897
os.makedirs("{0}/{1}".format(localMspConfigPath, "keystore"))
898+
os.makedirs("{0}/{1}".format(localMspConfigPath, "tlscacerts"))
899+
#TODO: Consider how to accomodate intermediate CAs
900+
os.makedirs("{0}/{1}".format(localMspConfigPath, "tlsintermediatecacerts"))
895901

896902
# Find the peer signer Tuple for this peer and add to signcerts folder
897903
for pnt, cert in [(peerNodeTuple, cert) for peerNodeTuple, cert in directory.ordererAdminTuples.items() if
@@ -908,6 +914,8 @@ def _writeMspFiles(self, directory , project_name, compose_service, network):
908914
org_cert_as_pem = directory.getOrganization(pnt.organization).getCertAsPEM()
909915
with open("{0}/cacerts/{1}.pem".format(localMspConfigPath, pnt.organization), "w") as f:
910916
f.write(org_cert_as_pem)
917+
with open("{0}/tlscacerts/{1}.pem".format(localMspConfigPath, pnt.organization), "w") as f:
918+
f.write(org_cert_as_pem)
911919

912920
# Find the peer admin Tuple for this peer and add to admincerts folder
913921
for pnt, cert in [(peerNodeTuple, cert) for peerNodeTuple, cert in directory.ordererAdminTuples.items() if

0 commit comments

Comments
 (0)