Uploaded image for project: 'Spring Web Services'
  1. Spring Web Services
  2. SWS-731

Create a TrustManagerFactoryBean for a simpler config of HttpsUrlConnectionMessageSender

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Complete
    • Affects Version/s: 2.0.2
    • Fix Version/s: 2.2.RC1
    • Component/s: Security
    • Labels:
      None

      Description

      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>

        Activity

        No work has yet been logged on this issue.

          People

          • Assignee:
            arjen.poutsma Arjen Poutsma
            Reporter:
            strug Leif Hanack
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: