Skip to content

Incorrect protocol (HTTPS) in generated links when running with HTTP #2371

@amalchuk

Description

@amalchuk

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:

  1. Start the application/library with an HTTP server.
  2. Observe the generated links (e.g., in logs, UI, or responses).
  3. 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:

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions