code: def install_certs(ssl_dir, certs, chain=None, user='root', group='root'):
      
      for cn, bundle in certs.items():
          cert_filename = 'cert_{}'.format(cn)
          key_filename = 'key_{}'.format(cn)
          cert_data = bundle['cert']
          if chain:
              # Append chain file so that clients that trust the root CA will
              # trust certs signed by an intermediate in the chain
              cert_data = cert_data + os.linesep + chain
          write_file(
              path=os.path.join(ssl_dir, cert_filename), owner=user, group=group,
              content=cert_data, perms=0o640)
          write_file(
              path=os.path.join(ssl_dir, key_filename), owner=user, group=group,
              content=bundle['key'], perms=0o640)
docs: Install the certs passed into the ssl dir and append the chain if
         provided.
  
      :param ssl_dir: str Directory to create symlinks in
      :param certs: {} {'cn': {'cert': 'CERT', 'key': 'KEY'}}
      :param chain: str Chain to be appended to certs
      :param user: (Optional) Owner of certificate files. Defaults to 'root'
      :type user: str
      :param group: (Optional) Group of certificate files. Defaults to 'root'
      :type group: str