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

RabbitMq management Rest Api connection issue with client using non public certificates #551

Closed
jmrt47 opened this issue Jan 23, 2017 · 3 comments

Comments

@jmrt47
Copy link

jmrt47 commented Jan 23, 2017

Creating a RabbitManagementTemplate instance there is no way to add trusted certificates or to change the http client. The underlying class Client creates a rest template instance without any option to configure trusted certificates. The HttpClientBuilder used to create the HttpComponentsClientHttpRequestFactory used by the RestTemplate doesn't call useSystemProperties() method so default properties like javax.net.ssl.trustStore doesn't work too.

Is there a way I messed by now I couldn't see a way to trust the server certificate with the RabbitManagementTemplate.

@garyrussell
Copy link
Contributor

Since the RabbitManagementTemplate is a lightweight wrapper around the Client, I suggest you raise this issue against hop.

@artembilan
Copy link
Member

M-m-m. I wonder why ctor like below isn't appropriate for you?

/**
   * Construct an instance with the provided url and credentials.
   * @param url the url e.g. "http://localhost:15672/api/".
   * @param username the user name.
   * @param password the password
   * @param sslContext ssl context for http client
   * @throws MalformedURLException for a badly formed URL.
   * @throws URISyntaxException for a badly formed URL.
   */
  public Client(URL url, String username, String password, SSLContext sslContext) throws MalformedURLException, URISyntaxException {

@jmrt47
Copy link
Author

jmrt47 commented Jan 25, 2017

Thanks for your quick response, I used the latest version (1.4.3.RELEASE) of spring-boot-starter-amqp which includes spring-rabbit in version 1.6.6.RELEASE and this includes the http-client in version 1.0.0.RELEASE. This version of http-client doesn't has no constructor like mentioned by @artembilan.
Excluding http-client from spring-boot-start-amqp and add latest version manually solved the issue for me.

@jmrt47 jmrt47 closed this as completed Jan 25, 2017
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

3 participants