Skip to content
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

Allow to pass query parameters in directory URL #152

Closed
mantik0r opened this issue Feb 1, 2024 · 2 comments
Closed

Allow to pass query parameters in directory URL #152

mantik0r opened this issue Feb 1, 2024 · 2 comments

Comments

@mantik0r
Copy link

mantik0r commented Feb 1, 2024

Hi,

I'm currently implementing the ACME interface for a CA and used your client library for testing the implementation which was very helpful.

During my tests I stumbled upon one thing in the GenericAcmeProvider which caused some issues in my tests:

public URL resolve(URI serverUri) {
      try {
          return new URL(serverUri.getScheme(), serverUri.getHost(), serverUri.getPort(), serverUri.getPath());
      } catch (MalformedURLException ex) {
          throw new IllegalArgumentException("Bad generic server URI", ex);
      }
  }

Any query parameters of the directory URL passed into acme4j will get stripped here. Since in my implementation query parameters of the directory URL are used to add additional information to the order URL (e.g. choosing different certificate types) this information is lost.
I know that is is possible to override this by writing a custom provider which is what I did in the end.

Nevertheless, I wanted to ask you if there is a particular reason why the URI is not passed in completely since there is no requirement in RFC 8555 which prohibits the use of query parameters.

@shred
Copy link
Owner

shred commented Feb 6, 2024

My plans are to reserve the query parameters as parameters to be used by the acme: URI style providers.

But I also didn't expect the directory resource to accept query parameters. 😃 The GenericAcmeProvider should not strip, but forward them. I will fix that.

@shred
Copy link
Owner

shred commented Feb 6, 2024

Generic URIs will now forward query parameters. Will be deployed with the next release. Thank you!

@shred shred closed this as completed Feb 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants