{"record":{"id":"6fae01179002ea0b","repo":"dgraph-io/dgraph","slug":"unsupported-file","errorCode":null,"errorMessage":"Unsupported file","messagePattern":"Unsupported file","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"info","filePath":"dgraph/cmd/cert/info.go","lineNumber":130,"sourceCode":"\t\t\tinfo.err = err\n\t\t\treturn &info\n\t\t}\n\t\tkey, ok := priv.(crypto.Signer)\n\t\tif !ok {\n\t\t\tinfo.err = errors.Errorf(\"Unknown private key type: %T\", key)\n\t\t}\n\t\tswitch k := key.(type) {\n\t\tcase *ecdsa.PrivateKey:\n\t\t\tinfo.algo = fmt.Sprintf(\"ECDSA %s (FIPS-3)\", k.PublicKey.Curve.Params().Name)\n\t\t\tinfo.digest = getHexDigest(elliptic.Marshal(k.PublicKey.Curve,\n\t\t\t\tk.PublicKey.X, k.PublicKey.Y))\n\t\tcase *rsa.PrivateKey:\n\t\t\tinfo.algo = fmt.Sprintf(\"RSA %d bits (PKCS#1)\", k.PublicKey.N.BitLen())\n\t\t\tinfo.digest = getHexDigest(k.PublicKey.N.Bytes())\n\t\t}\n\n\tdefault:\n\t\tinfo.err = errors.Errorf(\"Unsupported file\")\n\t}\n\n\treturn &info\n}\n\n// getHexDigest returns a SHA-256 hex digest broken up into 32-bit chunks\n// so that they easier to compare visually\n// e.g. 4A2B0F0F 716BF5B6 C603E01A 6229D681 0B2AFDC5 CADF5A0D 17D59299 116119E5\nfunc getHexDigest(data []byte) string {\n\tconst groupSizeBytes = 4\n\n\tdigest := sha256.Sum256(data)\n\tgroups := len(digest) / groupSizeBytes\n\thex := fmt.Sprintf(\"%0*X\", groupSizeBytes*2, digest[0:groupSizeBytes])\n\tfor i := 1; i < groups; i++ {\n\t\thex += fmt.Sprintf(\" %0*X\", groupSizeBytes*2,\n\t\t\tdigest[i*groupSizeBytes:(i+1)*groupSizeBytes])\n\t}","sourceCodeStart":112,"sourceCodeEnd":148,"githubUrl":"https://github.com/dgraph-io/dgraph/blob/759e242be62c91f8d084da06ad0c8d21256d9c07/dgraph/cmd/cert/info.go#L112-L148","documentation":"The outermost default case of getFileInfo handles files that are neither certificates nor keys. Any file in the TLS directory that isn't named like a cert or key lands here and gets 'Unsupported file' recorded in info.err.","triggerScenarios":"Running `dgraph cert info` when the directory contains files that are not ca.crt/node.crt/client.*.crt certs nor ca.key/node.key/client.*.key files — e.g. CSRs, .pem bundles, README files, or index/serial files.","commonSituations":"Pointing --dir at the wrong folder, leftover files from external PKI tooling (requests/, serial, index.txt), or .srl/.csr files generated during manual CA work.","solutions":["Remove or move non-cert/key files out of the TLS directory","Point `dgraph cert info --dir` at the directory created by `dgraph cert create`","Rename files to dgraph's expected scheme if they are genuinely certs/keys (see error 63/65)"],"exampleFix":"// before\ntls/: ca.crt ca.key ca.csr ca.srl notes.txt\ndgraph cert info  # ca.csr etc -> Unsupported file\n// after\nmv tls/ca.csr tls/ca.srl tls/notes.txt /tmp/backup/  # rerun dgraph cert info","handlingStrategy":"validation","validationCode":"func isSupportedFileName(name string) bool {\n    if name == \"ca.crt\" || name == \"ca.key\" { return true }\n    certPrefix := strings.HasPrefix(name, \"node.\") || strings.HasPrefix(name, \"client.\")\n    isCert := strings.HasSuffix(name, \".crt\")\n    isKey := strings.HasSuffix(name, \".key\")\n    return certPrefix && (isCert || isKey)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Point dgraph cert info --dir only at directories created by dgraph cert create","Move CSRs, .srl files, and notes out of the TLS directory","Audit the TLS dir contents with ls before running cert info"],"tags":["tls","cli","file-management"],"backgroundTag":"unsupported-file-type","analyzedSha":"759e242be62c91f8d084da06ad0c8d21256d9c07","analyzedAt":"2026-09-01T14:42:12.034Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}