title: Adding/Configuring the Subject Alternative Name of the CA certificate in Hyperledger Fabric CA
body: <p>I have a couple of Hyperledger Fabric networks (1.4 and 2.3+ versions) working OK but I have a annoying configuration problem with the CA.</p>
  <p>The certificate for the CA that my artifacts generate (configtx.yaml) and (crypto-config.yaml) has as CN value &quot;ca.myorg.org&quot;. This means that the CA only accepts requests to that host address. If I do a request to host &quot;ca&quot; (which is the host name created by the Kubernetes cluster) I get:</p>
  <p>&quot;hyperledger client doesn't match any of the subject alternative names&quot; error from the CA instance.</p>
  <p>I use Kubernetes to deploy the network and the service name are &quot;ca&quot;, &quot;peer1&quot;, ...
  so I cannot simply set ca.myorg.org as service name... this implies that I have to:</p>
  <ol>
  <li>Add a custom DNS alias in the Kubernetes inner DNS to map ca -&gt; ca.myorg.org so I can run requests to ca.myorg.org from the Chaincode Java client pod. (requests to &quot;ca&quot; will be rejected by CA.</li>
  <li>When I run tests from outside the Kubernetes network, I need to use Kubefwd, which is OK, but that will create a local hosts entry &quot;ca&quot; in my computer... everytime I need to manually add that alias too to the hosts file. Very annoying.</li>
  </ol>
  <p>My question is... how can I configure the artifacts so &quot;ca&quot; is also accepted as a Subject Alternative Name in the generated certificate for the CA? That would solve my problem.</p>
  <p>As a work around, can I also alter the certificate adding the &quot;ca&quot; subject alternative name, after it's generated? That would work.</p>
  <p>Of course, maybe I am missing something on all this artifact certificate generation when creating the Hyperledger Fabric network. I'm all ears for suggestions on what approach to take when the CA is going to be deployed in Kubernetes.</p>