title: How to set tls in fabric-ca
body: <p>I want to enable tls in fabric-ca ,so :</p>
  
  <p>step: I modyfied fabric-ca-clien-config.yaml </p>
  
  <pre><code>tls:
    # TLS section for secure socket connection
    certfiles:
         - /Users/jiangnan/Documents/GOPATH/src/github.com/hyperledger/fabric-samples/first-network/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt
    client:
      certfile: /Users/jiangnan/Documents/GOPATH/src/github.com/hyperledger/fabric-samples/first-network/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.crt
      keyfile: /Users/jiangnan/Documents/GOPATH/src/github.com/hyperledger/fabric-samples/first-network/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.key
  </code></pre>
  
  <p>and </p>
  
  <pre><code>fabric-ca-server start -b admin:adminpw
  </code></pre>
  
  <p>but when I enroll:</p>
  
  <pre><code>export FABRIC_CA_CLIENT_HOME=/Users/jiangnan/Documents/GOPATH/src/github.com/hyperledger/clients/admin
  fabric-ca-client enroll -u https://admin:adminpw@localhost:7054
  </code></pre>
  
  <p>it appears </p>
  
  <pre><code>2018/09/28 13:36:33 [INFO] encoded CSR
  Error: POST failure of request: POST https://localhost:7054/enroll
  {"hosts":["jiangdeimac.cn.ibm.com"],"certificate_request":"-----BEGIN CERTIFICATE REQUEST-----\nMIIBSzCB8wIBADBdMQswCQYDVQQGEwJVUzEXMBUGA1UECBMOTm9ydGggQ2Fyb2xp\nbmExFDASBgNVBAoTC0h5cGVybGVkZ2VyMQ8wDQYDVQQLEwZGYWJyaWMxDjAMBgNV\nBAMTBWFkbWluMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE6IAf/x032Df4byre\nGJ3dEI1ayE+8t8eyW5R/+ExvZJLk/OK7BrepO5HtHwYg3V2FkNwdB1iV2pq/yxTX\nthZIsqA0MDIGCSqGSIb3DQEJDjElMCMwIQYDVR0RBBowGIIWamlhbmdkZWltYWMu\nY24uaWJtLmNvbTAKBggqhkjOPQQDAgNHADBEAiBzNGIF1avzD9Tbkrh3Qh2E6gVN\nKlHsXiPOZTjpSVfO0wIgCkXYx0MTQseJfjdAgXZUE7dPQqEGRg2JxTOfI2PQi5c=\n-----END CERTIFICATE REQUEST-----\n","profile":"","crl_override":"","label":"","NotBefore":"0001-01-01T00:00:00Z","NotAfter":"0001-01-01T00:00:00Z","CAName":""}: Post https://localhost:7054/enroll: x509: certificate is valid for peer0.org1.example.com, peer0, not localhost
  </code></pre>
  
  <p>the ca-server logs is"</p>
  
  <pre><code>2018/09/28 13:36:33 http: TLS handshake error from [::1]:57762: remote error: tls: bad certificate
  </code></pre>
  
  <p>so I want to know how can I set tls using fabric-ca?</p>