C:\Users\cups>openssl req -config openssl.cnf -key ca.key.pem -new -x509 -days 7300 -sha256 -extensions v3_ca -out ca.cert.pem You are about to be asked to enter information that will be incorporated into your certificate request. What you are about to enter is what is called a Distinguished Name or a DN. There are quite a few fields but you can leave some blank For some fields there will be a default value, If you enter '.', the field will be left blank. ----- Country Name (2 letter code) [CN]: State or Province Name [China]: Locality Name []: Organization Name [Hyperledger]: Organizational Unit Name [Fabric]: Common Name [fabric-ca-server]: Email Address []:
[ policy_strict ] # The root CA should only sign intermediate certificates that match. # See the POLICY FORMAT section of `man ca`. countryName = match stateOrProvinceName = match organizationName = match organizationalUnitName = optional commonName = supplied emailAddress = optional
[ policy_loose ] # Allow the intermediate CA to sign a more diverse range of certificates. # See the POLICY FORMAT section of the `ca` man page. countryName = optional stateOrProvinceName = optional localityName = optional organizationName = optional organizationalUnitName = optional commonName = supplied emailAddress = optional
[ req ] # Options for the `req` tool (`man req`). default_bits = 2048 distinguished_name = req_distinguished_name string_mask = utf8only
# SHA-1 is deprecated, so use SHA-2 instead. default_md = sha256
# Extension to add when the -x509 option is used. x509_extensions = v3_ca
req_extensions = v3_req
[ req_distinguished_name ] # See <https://en.wikipedia.org/wiki/Certificate_signing_request>. countryName = Country Name (2 letter code) stateOrProvinceName = State or Province Name localityName = Locality Name 0.organizationName = Organization Name organizationalUnitName = Organizational Unit Name commonName = Common Name emailAddress = Email Address
cups@ubuntu:~/Desktop/test$ docker-compose -f docker-compose.yaml up Starting ca ... done Attaching to ca ca | 2020/09/15 01:34:27 [DEBUG] Home directory: /etc/hyperledger/fabric-ca-server ca | 2020/09/15 01:34:27 [INFO] Configuration file location: /etc/hyperledger/fabric-ca-server/fabric-ca-server-config.yaml ca | 2020/09/15 01:34:27 [INFO] Starting server in home directory: /etc/hyperledger/fabric-ca-server ca | 2020/09/15 01:34:27 [DEBUG] Set log level: ca | 2020/09/15 01:34:27 [INFO] Server Version: 1.4.3 ca | 2020/09/15 01:34:27 [INFO] Server Levels: &{Identity:2 Affiliation:1 Certificate:1 Credential:1 RAInfo:1 Nonce:1} ca | 2020/09/15 01:34:27 [DEBUG] Making server filenames absolute ca | 2020/09/15 01:34:27 [DEBUG] Initializing default CA in directory /etc/hyperledger/fabric-ca-server ca | 2020/09/15 01:34:27 [DEBUG] Init CA with home /etc/hyperledger/fabric-ca-server and config {Version:1.4.3 Cfg:{Identities:{PasswordAttempts:10 AllowRemove:false} Affiliations:{AllowRemove:false}} CA:{Name:ca Keyfile:/etc/hyperledger/fabric-ca-server-config/ca.key.pem Certfile:/etc/hyperledger/fabric-ca-server-config/ca.cert.pem Chainfile:ca-chain.pem} Signing:0xc0001cd4f0 CSR:{CN:fabric-ca-server Names:[{C:US ST:North Carolina L: O:Hyperledger OU:Fabric SerialNumber:}] Hosts:[302115a9775b localhost] KeyRequest:0xc000542d60 CA:0xc000542de0 SerialNumber:} Registry:{MaxEnrollments:-1 Identities:[{ Name:**** Pass:**** Type:client Affiliation: MaxEnrollments:0 Attrs:map[hf.GenCRL:1 hf.Registrar.Attributes:* hf.AffiliationMgr:1 hf.Registrar.Roles:* hf.Registrar.DelegateRoles:* hf.Revoker:1 hf.IntermediateCA:1] }]} Affiliations:map[org2:[department1] org1:[department1 department2]] LDAP:{ Enabled:false URL:ldap://****:****@<host>:<port>/<base> UserFilter:(uid=%s) GroupFilter:(memberUid=%s) Attribute:{[uid member] [{ }] map[groups:[{ }]]} TLS:{false [] { }} } DB:{ Type:sqlite3 Datasource:fabric-ca-server.db TLS:{false [] { }} } CSP:0xc0005425e0 Client:<nil> Intermediate:{ParentServer:{ URL: CAName: } TLS:{Enabled:false CertFiles:[] Client:{KeyFile: CertFile:}} Enrollment:{ Name: Secret:**** CAName: AttrReqs:[] Profile: Label: CSR:<nil> Type:x509 }} CRL:{Expiry:24h0m0s} Idemix:{IssuerPublicKeyfile: IssuerSecretKeyfile: RevocationPublicKeyfile: RevocationPrivateKeyfile: RHPoolSize:1000 NonceExpiration:15s NonceSweepInterval:15m}} ca | 2020/09/15 01:34:27 [DEBUG] CA Home Directory: /etc/hyperledger/fabric-ca-server ca | 2020/09/15 01:34:27 [DEBUG] Checking configuration file version '1.4.3' against server version: '1.4.3' ca | 2020/09/15 01:34:27 [DEBUG] Initializing BCCSP: &{ProviderName:SW SwOpts:0xc000466400 PluginOpts:<nil>} ca | 2020/09/15 01:34:27 [DEBUG] Initializing BCCSP with software options &{SecLevel:256 HashFamily:SHA2 Ephemeral:false FileKeystore:0xc00018ef30 DummyKeystore:<nil> InmemKeystore:<nil>} ca | 2020/09/15 01:34:27 [DEBUG] Initialize key material ca | 2020/09/15 01:34:27 [DEBUG] Making CA filenames absolute ca | 2020/09/15 01:34:27 [INFO] The CA key and certificate files already exist ca | 2020/09/15 01:34:27 [INFO] Key file location: /etc/hyperledger/fabric-ca-server-config/ca.key.pem ca | 2020/09/15 01:34:27 [INFO] Certificate file location: /etc/hyperledger/fabric-ca-server-config/ca.cert.pem ca | 2020/09/15 01:34:27 [DEBUG] Validating the CA certificate and key ca | 2020/09/15 01:34:27 [DEBUG] Check CA certificate for valid dates ca | 2020/09/15 01:34:27 [DEBUG] Check CA certificate for valid usages ca | 2020/09/15 01:34:27 [DEBUG] Check CA certificate for valid IsCA value ca | 2020/09/15 01:34:27 [DEBUG] Check that key type is supported ca | 2020/09/15 01:34:27 [DEBUG] Check that key size is of appropriate length ca | 2020/09/15 01:34:27 [DEBUG] Check that public key and private key match ca | 2020/09/15 01:34:27 [DEBUG] Validation of CA certificate and key successful ca | 2020/09/15 01:34:27 [DEBUG] Loading CN from existing enrollment information ca | 2020/09/15 01:34:27 [DEBUG] Initializing DB ca | 2020/09/15 01:34:27 [DEBUG] Initializing 'sqlite3' database at '/etc/hyperledger/fabric-ca-server/fabric-ca-server.db' ca | 2020/09/15 01:34:27 [DEBUG] Using sqlite database, connect to database in home (/etc/hyperledger/fabric-ca-server/fabric-ca-server.db) directory ca | 2020/09/15 01:34:27 [DEBUG] Creating SQLite database (/etc/hyperledger/fabric-ca-server/fabric-ca-server.db) if it does not exist... ca | 2020/09/15 01:34:27 [DEBUG] Creating users table if it does not exist ca | 2020/09/15 01:34:27 [DEBUG] Creating affiliations table if it does not exist ca | 2020/09/15 01:34:27 [DEBUG] Creating certificates table if it does not exist ca | 2020/09/15 01:34:27 [DEBUG] Creating credentials table if it does not exist ca | 2020/09/15 01:34:27 [DEBUG] Creating revocation_authority_info table if it does not exist ca | 2020/09/15 01:34:27 [DEBUG] Creating nonces table if it does not exist ca | 2020/09/15 01:34:27 [DEBUG] Creating properties table if it does not exist ca | 2020/09/15 01:34:27 [DEBUG] Successfully opened sqlite3 DB ca | 2020/09/15 01:34:27 [DEBUG] Initializing identity registry ca | 2020/09/15 01:34:27 [DEBUG] Initialized DB identity registry ca | 2020/09/15 01:34:27 [DEBUG] Checking database levels '&{Identity:2 Affiliation:1 Certificate:1 Credential:1 RAInfo:1 Nonce:1}' against server levels '&{Identity:2 Affiliation:1 Certificate:1 Credential:1 RAInfo:1 Nonce:1}' ca | 2020/09/15 01:34:27 [DEBUG] Loading identity table ca | 2020/09/15 01:34:27 [DEBUG] Loading identity 'admin' ca | 2020/09/15 01:34:27 [DEBUG] DB: Getting identity admin ca | 2020/09/15 01:34:27 [DEBUG] Identity 'admin' already registered, loaded identity ca | 2020/09/15 01:34:27 [DEBUG] Successfully loaded identity table ca | 2020/09/15 01:34:27 [DEBUG] Loading affiliations table ca | 2020/09/15 01:34:27 [DEBUG] DB: Add affiliation org2 ca | 2020/09/15 01:34:27 [DEBUG] Affiliation 'org2' already exists ca | 2020/09/15 01:34:27 [DEBUG] DB: Add affiliation org2.department1 ca | 2020/09/15 01:34:27 [DEBUG] Affiliation 'org2.department1' already exists ca | 2020/09/15 01:34:27 [DEBUG] DB: Add affiliation org1 ca | 2020/09/15 01:34:27 [DEBUG] Affiliation 'org1' already exists ca | 2020/09/15 01:34:27 [DEBUG] DB: Add affiliation org1.department1 ca | 2020/09/15 01:34:27 [DEBUG] Affiliation 'org1.department1' already exists ca | 2020/09/15 01:34:27 [DEBUG] DB: Add affiliation org1.department2 ca | 2020/09/15 01:34:27 [DEBUG] Affiliation 'org1.department2' already exists ca | 2020/09/15 01:34:27 [DEBUG] Successfully loaded affiliations table ca | 2020/09/15 01:34:27 [INFO] Initialized sqlite3 database at /etc/hyperledger/fabric-ca-server/fabric-ca-server.db ca | 2020/09/15 01:34:27 [DEBUG] Initializing enrollment signer ca | 2020/09/15 01:34:27 [DEBUG] validating configuration ca | 2020/09/15 01:34:27 [DEBUG] validate local profile ca | 2020/09/15 01:34:27 [DEBUG] profile is valid ca | 2020/09/15 01:34:27 [DEBUG] validate local profile ca | 2020/09/15 01:34:27 [DEBUG] profile is valid ca | 2020/09/15 01:34:27 [DEBUG] validate local profile ca | 2020/09/15 01:34:27 [DEBUG] profile is valid ca | 2020/09/15 01:34:27 [DEBUG] CA initialization successful ca | 2020/09/15 01:34:27 [DEBUG] Initializing Idemix issuer... ca | 2020/09/15 01:34:27 [INFO] The Idemix issuer public and secret key files already exist ca | 2020/09/15 01:34:27 [INFO] secret key file location: /etc/hyperledger/fabric-ca-server/msp/keystore/IssuerSecretKey ca | 2020/09/15 01:34:27 [INFO] public key file location: /etc/hyperledger/fabric-ca-server/IssuerPublicKey ca | 2020/09/15 01:34:27 [DEBUG] Intializing revocation authority for issuer 'ca' ca | 2020/09/15 01:34:27 [DEBUG] Initialize Idemix issuer revocation key material ca | 2020/09/15 01:34:27 [INFO] The Idemix issuer revocation public and secret key files already exist ca | 2020/09/15 01:34:27 [INFO] private key file location: /etc/hyperledger/fabric-ca-server/msp/keystore/IssuerRevocationPrivateKey ca | 2020/09/15 01:34:27 [INFO] public key file location: /etc/hyperledger/fabric-ca-server/IssuerRevocationPublicKey ca | 2020/09/15 01:34:27 [DEBUG] Intializing nonce manager for issuer 'ca' ca | 2020/09/15 01:34:27 [INFO] Home directory for default CA: /etc/hyperledger/fabric-ca-server ca | 2020/09/15 01:34:27 [DEBUG] 1 CA instance(s) running on server ca | 2020/09/15 01:34:27 [INFO] Operation Server Listening on 127.0.0.1:9443 ca | 2020/09/15 01:34:27 [INFO] Listening on http://0.0.0.0:7054
cups@ubuntu:~/Desktop/test$ docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 302115a9775b hyperledger/fabric-ca "sh -c 'fabric-ca-se…" 14 hours ago Up 20 minutes 0.0.0.0:7054->7054/tcp ca cups@ubuntu:~/Desktop/test$
cups@ubuntu:~/Desktop/test$ docker exec -it 302115a9775b /bin/bash root@302115a9775b:/# ls bin boot dev etc home lib lib64 media mnt opt proc root run sbin srv sys tmp usr var root@302115a9775b:/# cd /etc/hyperledger/fabric-ca-server root@302115a9775b:/etc/hyperledger/fabric-ca-server# ls IssuerPublicKey IssuerRevocationPublicKey ca-cert.pem ca-key.pem fabric-ca-server-config.yaml fabric-ca-server.db msp root@302115a9775b:/etc/hyperledger/fabric-ca-server#