-
-
Notifications
You must be signed in to change notification settings - Fork 121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Localhost Self Signed SSL cert fails to download swagger.json #276
Comments
Investigating a little myself, it seems you do not do any fetching of the file and are using So if this package can support passing config, flag to support it would be fab Now to dig down the rabbit hole of that NPM package's repo 😄 |
OK seems like can fetch can use Now to find the fetch or HTTP call to get the JSON/YML from inside this other package |
Bingo found it Leaving my notes here for anyone else reading along, but for now I need sleep. |
@warrenbuckley thanks for the bug report. Is this a bug with the underlying |
Thanks for the thorough investigation @warrenbuckley! |
@jordanshatford and @mrlubos its with the dependant package from what I can tell. |
@warrenbuckley to help us prioritise, how critical is this? Does it prevent you from using the package altogether? |
@mrlubos its an annoyance, as I think I can try to get it to generate a client from localhost using HTTP and without SSL, but it would be nice if it just worked. If I manage to do a PR to the other package, would you be happy for me to contribute a fix here as well ? |
@warrenbuckley you mean JSON schema ref parser? Totally, we spoke about this with Jordan and think it's a reasonable expectation to have this working. We could even fork that package and depend on the fork if they're slow to review changes |
As a temporary work around you should be able to use |
@Terit I was not able to get that to work for me. NPM Script
Error Back from Console
|
@warrenbuckley Try it with cross-env. It's allowed me to keep my sanity working on Windows with a Linux CI process. |
OK thanks @Terit 🥰 For anyone else reading this issue/thread Install Then updated my script to
|
Get it to work with HTTPS with self signed SSL Cert by using cross-env and a NODE command before hey-api/openapi-ts#276 (comment)
You saved my day with that @Terit 🙏 |
@Sulray I think the library would have to add a flag to set a path to your cert. That would allow them to do something like this: let opts = {
method: 'GET',
hostname: "localhost",
port: listener.address().port,
path: '/',
ca: fs.readFileSync("cacert.pem")
};
https.request(opts, (response) => { }).end(); I doubt @mrlubos would prioritize that as the Node flag is a sufficient workaround for most cases. |
You're spot on @Terit 😀 it doesn't seem to be a huge pain for people right now given the workaround |
Just to say thanks for this thread ! |
@warrenbuckley do you have a self-signed local certificate? If I allowed you to pass custom config options, which values would you need? |
@mrlubos I'm running into the same issue now - I'd guess being able to specify a path to a |
@rigtigeEmil does the workaround posted above not work for you? I can also enable what you described |
Yeah it does - I edited my comment above cause i thought it didn't. Turns out you need to run your API locally before it works 🤦 |
Description
I have a .NETCore webserver hosting/serving a swagger file that is running on localhost over https with a self signed SSL certificate. But trying to do so I get the following error.
OpenAPI specification (optional)
Configuration
openapi-ts --input https://localhost:44312/umbraco/swagger/AccessibilityReporter/swagger.json --output src/Api
System information (optional)
OS:
Windows 11
NPM:
10.2.4
Node:
20.11.0
The text was updated successfully, but these errors were encountered: