{"record":{"id":"06e0e1710f5210b6","repo":"gatsbyjs/gatsby","slug":"you-re-trying-to-generate-a-ssl-certificate-for-an","errorCode":null,"errorMessage":"You're trying to generate a ssl certificate for an IP (${sslHost}). Please use a hostname instead.","messagePattern":"You're trying to generate a ssl certificate for an IP \\((.+?)\\)\\. Please use a hostname instead\\.","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/gatsby/src/commands/develop.ts","lineNumber":215,"sourceCode":"  if ((program[`cert-file`] || program[`key-file`]) && !program.https) {\n    reporter.panic(\n      `for custom ssl --https, --cert-file, and --key-file must be used together`\n    )\n  }\n\n  // Check if https is enabled, then create or get SSL cert.\n  // Certs are named 'devcert' and issued to the host.\n  // NOTE(@mxstbr): We mutate program.ssl _after_ passing it\n  // to the develop process controllable script above because\n  // that would mean we double SSL browser => proxy => server\n  if (program.https) {\n    const sslHost =\n      program.host === `0.0.0.0` || program.host === `::`\n        ? `localhost`\n        : program.host\n\n    if (REGEX_IP.test(sslHost)) {\n      reporter.panic(\n        `You're trying to generate a ssl certificate for an IP (${sslHost}). Please use a hostname instead.`\n      )\n    }\n\n    const ssl = await getSslCert({\n      name: sslHost,\n      caFile: program[`ca-file`],\n      certFile: program[`cert-file`],\n      keyFile: program[`key-file`],\n      directory: program.directory,\n    })\n\n    if (ssl) {\n      program.ssl = ssl\n    }\n  }\n\n  const developProcess = new ControllableScript(","sourceCodeStart":197,"sourceCodeEnd":233,"githubUrl":"https://github.com/gatsbyjs/gatsby/blob/8b06340921ffdf23125a365b9c9923690cb62ce6/packages/gatsby/src/commands/develop.ts#L197-L233","documentation":"Thrown by `gatsby develop` when --https is set and the resolved host (after normalizing 0.0.0.0/:: to localhost) matches an IP address (REGEX_IP). devcert cannot issue a trusted certificate for a bare IP, so the command panics asking the user to use a hostname instead.","triggerScenarios":"program.https is true and sslHost (program.host, or 'localhost' when host is 0.0.0.0/::) matches REGEX_IP, e.g. `--https -H 192.168.1.10`.","commonSituations":"Pointing the dev server at a LAN IP for testing on another device; passing a docker host IP; using tailscale/full IP-only addressing.","solutions":["Use a hostname instead of an IP: `--https -H mymachine.local` or a DNS-resolvable name.","Add a hosts entry (e.g. 127.0.0.1 mymachine.local) and pass that hostname.","If you must serve over an IP, terminate TLS upstream with a valid cert and run Gatsby over plain HTTP behind the proxy."],"exampleFix":"// before\ngatsby develop --https -H 192.168.1.10\n// after\ngatsby develop --https -H mymachine.local","handlingStrategy":"validation","validationCode":"// Reject IP hosts before launching gatsby develop with HTTPS\nconst REGEX_IP = /^(\\d{1,3}\\.){3}\\d{1,3}$|^[0-9a-fA-F:]+$/\nif (argv.https && REGEX_IP.test(argv.host)) {\n  throw new Error('Use a hostname, not an IP, for HTTPS dev certs')\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use a local hostname (mymachine.local) for HTTPS dev.","Add a hosts entry mapping the hostname to the IP you want to bind.","Terminate TLS upstream if an IP-only deployment is unavoidable."],"tags":["cli","ssl","https","develop","devcert"],"backgroundTag":null,"analyzedSha":"8b06340921ffdf23125a365b9c9923690cb62ce6","analyzedAt":"2026-08-13T02:36:21.405Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}