Redocly / Redocly/redocly-cli

Allow self signed certificate when request openapi json from website

Open
#1,017 2 comments 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

p3 Type: Enhancement
Dominant language
TypeScript
Stars
1.5k
Forks
228
Avg merge
1d 14h
Merged PRs (30d)
48

Description

Is your feature request related to a problem? Please describe.

When i use redoc-cli to build, i can't generate html with url under self signed cert

npx redoc-cli build  URL_WITH_SELF_SIGNED_CERT

This is the error message

Error: request to URL_WITH_SELF_SIGNED_CERT failed, reason: self signed certificate
    at BaseResolver.<anonymous> (/home/user/.npm/_npx/088c5868f11c5564/node_modules/redoc-cli/node_modules/@redocly/openapi-core/lib/resolve.js:117:23)
    at Generator.throw (<anonymous>)
    at rejected (/home/user/.npm/_npx/088c5868f11c5564/node_modules/redoc-cli/node_modules/@redocly/openapi-core/lib/resolve.js:6:65)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)

Describe the solution you'd like

simular to curl, a -k or --insecure options allow to bypass the cert check will be great

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the redoc-cli build command handling and the request path shown in @redocly/openapi-core/lib/resolve.js. Run the reported npx redoc-cli build command against a URL using a self-signed certificate, then trace how request options reach the resolver. Done means an explicit insecure option allows that build to generate HTML without the certificate error.

Written by the indexing model from the issue text.

Assessment

Tech stack
node.js, openapi, typescript
Domain
api, cli
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.