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

Create a TrustManagerFactoryBean for a simpler config of HttpsUrlConnectionMessageSender [SWS-731] #821

Closed
gregturn opened this issue Sep 14, 2011 · 4 comments
Assignees
Milestone

Comments

@gregturn
Copy link
Member

Leif Hanack opened SWS-731 and commented

The HttpsUrlConnectionMessageSender allow you to set the keyManagers and trustManagers. It would be cool, if Spring Webservice provides s.th. like a KeyManagerFactoryBean and a TrustManagerFactoryBean, so that you can easily secured a webservice connection.

These beans should hide the glue code for creating these managers.

// s.th. like this (only one and no error handling and all that)
public TrustManager[] getTrustManagers() {
  TrustManagerFactory factory = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
  factory.init(keyStore);
  return factory.getTrustManagers();
}

A config file might look like this:

  <bean id="messageSender" class="org.springframework.ws.transport.http.HttpsUrlConnectionMessageSender">
    <property name="trustManagers" ref="trustManagers"/>
  </bean>

  <bean id="trustManagers" class="org.springframework.ws.soap.security.support.TrustManagerFactoryBean">
    <constructor-arg type="java.security.KeyStore"><ref bean="keyStore"></constructor-arg>
    <!-- next managers .. -->
  </bean>

  <bean id="keyStore" class="org.springframework.ws.soap.security.support.KeyStoreFactoryBean">
    ..
  </bean>

Affects: 2.0.2

Referenced from: commits 9f4e293

@gregturn
Copy link
Member Author

Arjen Poutsma commented

A KeyManagersFactoryBean was introduced in 2.1.2.

@gregturn
Copy link
Member Author

Leif Hanack commented

Cool, than only a TrustManagerFactoryBean is missing :)

@gregturn
Copy link
Member Author

Arjen Poutsma commented

Done.

@gregturn
Copy link
Member Author

Leif Hanack commented

Great. Thank you for solving this issue so quick after you found it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants