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

        strug Leif Hanack created issue -
        arjen.poutsma Arjen Poutsma made changes -
        Field Original Value New Value
        Assignee Arjen Poutsma [ arjen.poutsma ]
        Fix Version/s 2.1 M1 [ 11748 ]
        arjen.poutsma Arjen Poutsma made changes -
        Fix Version/s 2.2 M1 [ 12850 ]
        Fix Version/s 2.1 M1 [ 11748 ]
        arjen.poutsma Arjen Poutsma made changes -
        Summary Create a KeyManagerFactoryBean and a TrustManagerFactoryBean for a simpler config of HttpsUrlConnectionMessageSender Create a TrustManagerFactoryBean for a simpler config of HttpsUrlConnectionMessageSender
        arjen.poutsma Arjen Poutsma made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Complete [ 8 ]

          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: