Uploaded image for project: 'WildFly'
  1. WildFly
  2. WFLY-4621

RESTEasy SMIME doesn't work with WildFly current module setup

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 10.0.0.Final
    • 9.0.0.CR1
    • REST
    • None

      RESTEasy provides the functions of SMIME encryption and here is an example that can be deployed into WildFly:

      https://github.com/liweinan/digital-signatures/tree/master/smime

      And currently resteasy-crypto module doesn't work properly in WildFly unless applied the following patch:

      Unable to find source-code formatter for language: diff. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
      power:modules weinanli$ git diff
      warning: LF will be replaced by CRLF in system/layers/base/org/bouncycastle/main/module.xml.
      The file will have its original line endings in your working directory.
      diff --git a/system/layers/base/org/bouncycastle/main/module.xml b/system/layers/base/org/bouncycastle/main/module.xml
      index 5d13395..83ae97c 100644
      --- a/system/layers/base/org/bouncycastle/main/module.xml
      +++ b/system/layers/base/org/bouncycastle/main/module.xml
      @@ -24,12 +24,17 @@
      
       <module xmlns="urn:jboss:module:1.3" name="org.bouncycastle">
           <resources>
      +      <!--
               <resource-root path="bcprov-jdk15on-1.52.jar"/>
               <resource-root path="bcmail-jdk15on-1.52.jar"/>
      +      -->
      +        <resource-root path="bcprov-jdk16-1.46.jar"/>
      +        <resource-root path="bcmail-jdk16-1.46.jar"/>
               <resource-root path="bcpkix-jdk15on-1.52.jar"/>
           </resources>
           <dependencies>
               <module name="javax.api"/>
      +        <module name="javax.mail.api"/>
      +        <module name="javax.activation.api"/>
           </dependencies>
      -
       </module>
      

      After applying the above patch then the example can pass all the tests:

      power:smime weinanli$ mvn -q clean package
      Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=128m; support was removed in 8.0
      power:smime weinanli$ mvn -q wildfly:deploy
      Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=128m; support was removed in 8.0
      May 11, 2015 9:24:27 PM org.xnio.Xnio <clinit>
      INFO: XNIO version 3.3.0.Final
      May 11, 2015 9:24:27 PM org.xnio.nio.NioXnio <clinit>
      INFO: XNIO NIO Implementation Version 3.3.0.Final
      May 11, 2015 9:24:27 PM org.jboss.remoting3.EndpointImpl <clinit>
      INFO: JBoss Remoting version 4.0.7.Final
      power:smime weinanli$ mvn -q integration-test
      Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=128m; support was removed in 8.0
      
      -------------------------------------------------------
       T E S T S
      -------------------------------------------------------
      Running org.jboss.resteasy.tests.smime.SMIMETest
      Encrypted Message From Server:
      Customer{name='Bill'}
      Signed Message From Server:
      Customer{name='Bill'}
      Customer{name='Bill'}
      Tests run: 6, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.682 sec - in org.jboss.resteasy.tests.smime.SMIMETest
      
      Results :
      
      Tests run: 6, Failures: 0, Errors: 0, Skipped: 0
      
      power:smime weinanli$
      

              weli@redhat.com Weinan Li
              weli@redhat.com Weinan Li
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Created:
                Updated:
                Resolved: