[GH-ISSUE #355] SSL certificate and secure calls #69

Closed
opened 2026-03-03 12:07:59 +03:00 by kerem · 2 comments
Owner

Originally created by @viAtom on GitHub (Oct 28, 2020).
Original GitHub issue: https://github.com/fsouza/fake-gcs-server/issues/355

We're using Node.js and based on the example, we should set the env var NODE_TLS_REJECT_UNAUTHORIZED to '0' to disable SSL checks. Unfortunately, it triggers this node warning :
Warning: Setting the NODE_TLS_REJECT_UNAUTHORIZED environment variable to '0' makes TLS connections and HTTPS requests insecure by disabling certificate verification.

I don't think there is much to do client-based and the curl calls made in the README are explicitly using the --insecure flag. Would it be possible or too much work to use a custom certificate in the server ? Like one created with let's encrypt or a given one that we can use in the SSL agent to remove this env var.

We are using fake-gcs-server for testing purposes and we want node warnings in the CI job so we can't disable node warnings only for this one, but it's polluting the test running output with node warnings.

Any idea on how we can proceed or does it need change on the repository ?
Thanks !

Originally created by @viAtom on GitHub (Oct 28, 2020). Original GitHub issue: https://github.com/fsouza/fake-gcs-server/issues/355 We're using Node.js and based on the example, we should set the env var `NODE_TLS_REJECT_UNAUTHORIZED` to `'0'` to disable SSL checks. Unfortunately, it triggers this node warning : `Warning: Setting the NODE_TLS_REJECT_UNAUTHORIZED environment variable to '0' makes TLS connections and HTTPS requests insecure by disabling certificate verification.` I don't think there is much to do client-based and the curl calls made in the README are explicitly using the `--insecure` flag. Would it be possible or too much work to use a custom certificate in the server ? Like one created with let's encrypt or a given one that we can use in the SSL agent to remove this env var. We are using `fake-gcs-server` for testing purposes and we want node warnings in the CI job so we can't disable node warnings only for this one, but it's polluting the test running output with node warnings. Any idea on how we can proceed or does it need change on the repository ? Thanks !
kerem closed this issue 2026-03-03 12:07:59 +03:00
Author
Owner

@fsouza commented on GitHub (Oct 28, 2020):

@viAtom you should be able to use http instead. For that you need to:

  • start the server with -scheme http
  • update the calling code to use http://<host>:<port> as the endpoint

Like, assuming the server is running on port 8080, you should be able to do something like this:

  const storage = new Storage({
    apiEndpoint: "http://localhost:8080",
    projectId: "myproj",
  });
<!-- gh-comment-id:717982829 --> @fsouza commented on GitHub (Oct 28, 2020): @viAtom you should be able to use http instead. For that you need to: - start the server with `-scheme http` - update the calling code to use `http://<host>:<port>` as the endpoint Like, assuming the server is running on port 8080, you should be able to do something like this: ```javascript const storage = new Storage({ apiEndpoint: "http://localhost:8080", projectId: "myproj", }); ```
Author
Owner

@viAtom commented on GitHub (Oct 31, 2020):

Thank you, it worked with this docker-compose config and your code, my CI thanks you too 🙏

    image: fsouza/fake-gcs-server:1.21
    command: -scheme http -port 8080
    ports:
      - 8080:8080
<!-- gh-comment-id:719943088 --> @viAtom commented on GitHub (Oct 31, 2020): Thank you, it worked with this docker-compose config and your code, my CI thanks you too 🙏 ```yaml image: fsouza/fake-gcs-server:1.21 command: -scheme http -port 8080 ports: - 8080:8080 ```
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/fake-gcs-server#69
No description provided.