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 ]
        Hide
        arjen.poutsma Arjen Poutsma added a comment -

        A KeyManagersFactoryBean was introduced in 2.1.2.

        Show
        arjen.poutsma Arjen Poutsma added a comment - A KeyManagersFactoryBean was introduced in 2.1.2.
        Hide
        strug Leif Hanack added a comment -

        Cool, than only a TrustManagerFactoryBean is missing

        Show
        strug Leif Hanack added a comment - Cool, than only a TrustManagerFactoryBean is missing
        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
        Hide
        arjen.poutsma Arjen Poutsma added a comment -

        Done.

        Show
        arjen.poutsma Arjen Poutsma added a comment - Done.
        arjen.poutsma Arjen Poutsma made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Complete [ 8 ]
        Hide
        strug Leif Hanack added a comment -

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

        Show
        strug Leif Hanack added a comment - Great. Thank you for solving this issue so quick after you found it
        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Resolved Resolved
        916d 16h 47m 1 Arjen Poutsma 19/Mar/14 4:40 AM

          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: