docs: def get_certificate_request(json_encode=True):
      """Generate a certificatee requests based on the network confioguration
  
      """
      req = CertRequest(json_encode=json_encode)
      req.add_hostname_cn()
      # Add os-hostname entries
      for net_type in [INTERNAL, ADMIN, PUBLIC]:
          net_config = config(ADDRESS_MAP[net_type]['override'])
          try:
              net_addr = resolve_address(endpoint_type=net_type)
              ip = network_get_primary_address(
                  ADDRESS_MAP[net_type]['binding'])
              addresses = [net_addr, ip]
              vip = get_vip_in_network(resolve_network_cidr(ip))
              if vip:
                  addresses.append(vip)
              if net_config:
                  req.add_entry(
                      net_type,
                      net_config,
                      addresses)
              else:
                  # There is network address with no corresponding hostname.
                  # Add the ip to the hostname cert to allow for this.
                  req.add_hostname_cn_ip(addresses)
          except NoNetworkBinding:
              log("Skipping request for certificate for ip in {} space, no "
                  "local address found".format(net_type), WARNING)
      return req.get_request()