-
Notifications
You must be signed in to change notification settings - Fork 502
Description
The application/library currently generates URLs with "https" as the protocol. This is problematic because the application can be run with an HTTP server. The hardcoded "https" prefix in certain parts of the code results in incorrect URLs being generated, which can lead to issues with functionality.
Steps to Reproduce:
- Start the application/library with an HTTP server.
- Observe the generated links (e.g., in logs, UI, or responses).
- Notice that the links are prefixed with "https" instead of "http."
Expected Behavior:
The application/library should dynamically determine the correct protocol (HTTP or HTTPS) based on the server configuration and generate links accordingly.
Impact:
Incorrect URLs generated by the application/library. This could lead to broken links, incorrect redirection, and other unexpected behavior.
Possible Solution:
Refactor the code to avoid hardcoding the protocol and instead dynamically determine the protocol based on the server configuration. (e.g., read the protocol from a http.Request
variable.)
Specific Locations of the Issue:
The hardcoded "https" prefix can be found in the following files:
- https://github.com/smallstep/certificates/blob/v0.28.4/acme/linker.go#L160
- https://github.com/smallstep/certificates/blob/v0.28.4/acme/linker.go#L222
- https://github.com/smallstep/certificates/blob/v0.28.4/acme/api/middleware.go#L195
Additional Context:
This issue affects both the standalone application and when the library is used as a dependency in other Go projects. I have created a proof-of-concept application that utilizes the 'acme' module from this library. The hardcoded 'https' protocol is preventing me from properly testing and deploying my application in an HTTP-only environment.