title: panic: runtime error: index out of range When starting the orderer with genesis.block
body: <p>I'm getting an index out of range when I try to start the orderer. I happens after does the config values of the orderer:</p>
  
  <pre><code>        Operations.TLS.Enabled = false
          Operations.TLS.PrivateKey = ""
          Operations.TLS.Certificate = ""
          Operations.TLS.RootCAs = []
          Operations.TLS.ClientAuthRequired = false
          Operations.TLS.ClientRootCAs = []
          Metrics.Provider = "disabled"
          Metrics.Statsd.Network = "udp"
          Metrics.Statsd.Address = "127.0.0.1:8125"
          Metrics.Statsd.WriteInterval = 30s
          Metrics.Statsd.Prefix = ""
  panic: runtime error: index out of range
  
  goroutine 1 [running]:
  github.com/hyperledger/fabric/msp.(*bccspmsp).sanitizeCert(0xc0002079e0, 0xc000111700, 0x26, 0xc000531108, 0x1)
          /opt/gopath/src/github.com/hyperledger/fabric/msp/mspimpl.go:691 +0x207
  github.com/hyperledger/fabric/msp.newIdentity(0xc000111700, 0x1152560, 0xc00000ef98, 0xc0002079e0, 0xc00035e148, 0x1152560, 0xc00000ef98, 0x0)
          /opt/gopath/src/github.com/hyperledger/fabric/msp/identities.go:47 +0x70
  github.com/hyperledger/fabric/msp.(*bccspmsp).getIdentityFromConf(0xc0002079e0, 0xc000354000, 0x3cd, 0x400, 0x1, 0x1, 0x0, 0x7c8088, 0xc0000ac7e0, 0xff)
          /opt/gopath/src/github.com/hyperledger/fabric/msp/mspimpl.go:161 +0x102
  github.com/hyperledger/fabric/msp.(*bccspmsp).setupCAs(0xc0002079e0, 0xc00014b1d0, 0x0, 0x0)
          /opt/gopath/src/github.com/hyperledger/fabric/msp/mspimplsetup.go:134 +0x65d
  github.com/hyperledger/fabric/msp.(*bccspmsp).preSetupV1(0xc0002079e0, 0xc00014b1d0, 0xc0005312f0, 0x7d23a0)
          /opt/gopath/src/github.com/hyperledger/fabric/msp/mspimplsetup.go:393 +0x64
  github.com/hyperledger/fabric/msp.(*bccspmsp).setupV1(0xc0002079e0, 0xc00014b1d0, 0x1, 0x1)
          /opt/gopath/src/github.com/hyperledger/fabric/msp/mspimplsetup.go:373 +0x39
  github.com/hyperledger/fabric/msp.(*bccspmsp).setupV1-fm(0xc00014b1d0, 0x1026ec0, 0x1a)
          /opt/gopath/src/github.com/hyperledger/fabric/msp/mspimpl.go:112 +0x34
  github.com/hyperledger/fabric/msp.(*bccspmsp).Setup(0xc0002079e0, 0xc00034a300, 0x0, 0xc00034a3c0)
          /opt/gopath/src/github.com/hyperledger/fabric/msp/mspimpl.go:225 +0x14d
  github.com/hyperledger/fabric/msp/cache.(*cachedMSP).Setup(0xc0004f2f90, 0xc00034a300, 0x1159600, 0xc0004f2f90)
          /opt/gopath/src/github.com/hyperledger/fabric/msp/cache/cache.go:88 +0x4b
  github.com/hyperledger/fabric/common/channelconfig.(*MSPConfigHandler).ProposeMSP(0xc000508550, 0xc00034a300, 0x19, 0xc0005314c8, 0x1, 0x1)
          /opt/gopath/src/github.com/hyperledger/fabric/common/channelconfig/msp.go:68 +0xc0
  github.com/hyperledger/fabric/common/channelconfig.(*OrganizationConfig).validateMSP(0xc00034a2c0, 0x0, 0xffffffffffffffff)
          /opt/gopath/src/github.com/hyperledger/fabric/common/channelconfig/organization.go:80 +0xc0
  github.com/hyperledger/fabric/common/channelconfig.(*OrganizationConfig).Validate(0xc00034a2c0, 0xc000531550, 0x1)
          /opt/gopath/src/github.com/hyperledger/fabric/common/channelconfig/organization.go:73 +0x2b
  github.com/hyperledger/fabric/common/channelconfig.NewOrganizationConfig(0xc0004fcf48, 0x6, 0xc0004f55e0, 0xc000508550, 0x0, 0x0, 0x8)
          /opt/gopath/src/github.com/hyperledger/fabric/common/channelconfig/organization.go:54 +0x10e
  github.com/hyperledger/fabric/common/channelconfig.NewConsortiumConfig(0xc0004f5590, 0xc000508550, 0xc0005316c0, 0xf07a40, 0xc0004f2e70)
          /opt/gopath/src/github.com/hyperledger/fabric/common/channelconfig/consortium.go:44 +0x196
  github.com/hyperledger/fabric/common/channelconfig.NewConsortiumsConfig(0xc0004f5540, 0xc000508550, 0xc000531808, 0x4, 0x1b8ac00)
          /opt/gopath/src/github.com/hyperledger/fabric/common/channelconfig/consortiums.go:31 +0x103
  github.com/hyperledger/fabric/common/channelconfig.NewChannelConfig(0xc0004f5040, 0x0, 0x0, 0x0)
          /opt/gopath/src/github.com/hyperledger/fabric/common/channelconfig/channel.go:104 +0x392
  github.com/hyperledger/fabric/common/channelconfig.NewBundle(0xc0004fd2e0, 0xc, 0xc0004f2780, 0xc000536510, 0x0, 0x0)
          /opt/gopath/src/github.com/hyperledger/fabric/common/channelconfig/bundle.go:196 +0x6b
  github.com/hyperledger/fabric/common/channelconfig.NewBundleFromEnvelope(0xc0004f4a50, 0x1444, 0x1500, 0x114b520)
          /opt/gopath/src/github.com/hyperledger/fabric/common/channelconfig/bundle.go:187 +0x14d
  github.com/hyperledger/fabric/orderer/common/server.ValidateBootstrapBlock(0xc000079940, 0xc000079940, 0xc000531be8)
          /opt/gopath/src/github.com/hyperledger/fabric/orderer/common/server/onboarding.go:349 +0xf7
  github.com/hyperledger/fabric/orderer/common/server.Start(0x1013e09, 0x5, 0xc0004c8900)
          /opt/gopath/src/github.com/hyperledger/fabric/orderer/common/server/main.go:97 +0x59
  github.com/hyperledger/fabric/orderer/common/server.Main()
          /opt/gopath/src/github.com/hyperledger/fabric/orderer/common/server/main.go:91 +0x1ce
  main.main()
          /opt/gopath/src/github.com/hyperledger/fabric/orderer/main.go:15 +0x20
  </code></pre>
  
  <p>I have gone to the place were it does and it is on this function.</p>
  
  <pre><code>
  func (msp *bccspmsp) sanitizeCert(cert *x509.Certificate) (*x509.Certificate, error) {
      if isECDSASignedCert(cert) {
          // Lookup for a parent certificate to perform the sanitization
          var parentCert *x509.Certificate
          chain, err := msp.getUniqueValidationChain(cert, msp.getValidityOptsForCert(cert))
          if err != nil {
              return nil, err
          }
  
          // at this point, cert might be a root CA certificate
          // or an intermediate CA certificate
          if cert.IsCA &amp;&amp; len(chain) == 1 {
              // cert is a root CA certificate
              parentCert = cert
          } else {
              parentCert = chain[1]
          }
  
          // Sanitize
          cert, err = sanitizeECDSASignedCert(cert, parentCert)
          if err != nil {
              return nil, err
          }
      }
      return cert, nil
  }
  
  </code></pre>
  
  <p>Its on</p>
  
  <pre><code>parentCert = chain[1]
  </code></pre>
  
  <p>I know that is a problem on my genesis block on my configtx file, and following the code of the error I guess that is looking at the ca files.</p>
  
  <p>So guessing that I have looked at the files and this is the following structure that I use:</p>
  
  <ul>
  <li>msp
  
  <ul>
  <li>admincerts (the certificate of the admin)</li>
  <li>tlscacerts (the tls cert of the tls-ca)</li>
  <li>cacerts (the tls cert of the ca cert)</li>
  </ul></li>
  </ul>
  
  <p>And everything is correct ad far as I know.</p>
  
  <p>EDIT 1:</p>
  
  <p>If put the logs on debug mode it gives the same error information, but is happening after the following:</p>
  
  <pre><code>2019-07-11 08:45:00.119 UTC [common.channelconfig] NewStandardValues -&gt; DEBU 0ed Initializing protos for *channelconfig.OrdererProtos
  2019-07-11 08:45:00.119 UTC [common.channelconfig] initializeProtosStruct -&gt; DEBU 0ee Processing field: ConsensusType
  2019-07-11 08:45:00.119 UTC [common.channelconfig] initializeProtosStruct -&gt; DEBU 0ef Processing field: BatchSize
  2019-07-11 08:45:00.119 UTC [common.channelconfig] initializeProtosStruct -&gt; DEBU 0f0 Processing field: BatchTimeout
  2019-07-11 08:45:00.119 UTC [common.channelconfig] initializeProtosStruct -&gt; DEBU 0f1 Processing field: KafkaBrokers
  2019-07-11 08:45:00.120 UTC [common.channelconfig] initializeProtosStruct -&gt; DEBU 0f2 Processing field: ChannelRestrictions
  2019-07-11 08:45:00.120 UTC [common.channelconfig] initializeProtosStruct -&gt; DEBU 0f3 Processing field: Capabilities
  2019-07-11 08:45:00.120 UTC [common.channelconfig] NewStandardValues -&gt; DEBU 0f4 Initializing protos for *channelconfig.OrganizationProtos
  2019-07-11 08:45:00.120 UTC [common.channelconfig] initializeProtosStruct -&gt; DEBU 0f5 Processing field: MSP
  2019-07-11 08:45:00.120 UTC [common.channelconfig] validateMSP -&gt; DEBU 0f6 Setting up MSP for org OrgMSP
  2019-07-11 08:45:00.120 UTC [msp] newBccspMsp -&gt; DEBU 0f7 Creating BCCSP-based MSP instance
  2019-07-11 08:45:00.120 UTC [msp] New -&gt; DEBU 0f8 Creating Cache-MSP instance
  2019-07-11 08:45:00.120 UTC [msp] Setup -&gt; DEBU 0f9 Setting up MSP instance OrgMSP
  2019-07-11 08:45:00.120 UTC [msp.identity] newIdentity -&gt; DEBU 0fa Creating identity instance for cert 
  
  </code></pre>