6 Replies Latest reply on Aug 21, 2008 1:30 PM by kapitanpetko

    seam mail + SSL + ca-cert.org

    renton1982

      Hi all...


      I try to send emails with seam-mail. On my local testing smtp-server with no security: no problem.


      But if i try to use our company-mailserver i get some errors like this:



      ... part of stacktrace:
      Caused by: javax.mail.MessagingException: Could not connect to SMTP host: my.server.com, port: 465;
        nested exception is:
              java.net.SocketException: Unconnected sockets not implemented
              at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1282)
              at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:370)
              at javax.mail.Service.connect(Service.java:297)
              at javax.mail.Service.connect(Service.java:156)
              at javax.mail.Service.connect(Service.java:105)
              at org.jboss.seam.mail.ui.UIMessage.encodeEnd(UIMessage.java:140)
              ... 72 more
      



      I think this i caused because our admin uses certificates by cacert.org and they are not in the javas truststore.


      Any ideas how i can teach seam to send my emails anyway?
      Maybe this could be a feature request on jira :-)


      Thanks a lot for replies & greetings from Vienna/Austria


      Berni


      (still loving seam)


        • 1. Re: seam mail + SSL + ca-cert.org
          renton1982

          problem solved:


          you have to import the root.crt and the class3.crt into your java-truststore


          for example on java 1.5 on ubuntu:


          first download the certs at cacert.org and:



          sudo keytool -import -file /home/user/class3.crt -alias cacertroot -trustcacerts -keystore /usr/lib/jvm/java-1.5.0-sun/jre/lib/security/cacerts
          sudo keytool -import -file /home/user/root.crt -alias cacertclass3 -trustcacerts -keystore /usr/lib/jvm/java-1.5.0-sun/jre/lib/security/cacerts


          so have fun with seam-mail and cacert.org certificates


          greetings

          • 2. Re: seam mail + SSL + ca-cert.org
            pmuir

            Or run Seam Mail with ssl and tls disabled -


            <mail:mail-session tls="false" ssl="false" />

            • 3. Re: seam mail + SSL + ca-cert.org
              renton1982

              that could be a solution, but some (secure) mailservers, like my one, only accepts ssl-connections :-)


              greetings

              • 4. Re: seam mail + SSL + ca-cert.org
                deanhiller2000

                hmmm, I have the same problem and I hate having to do that on every developer's machine.  Is there any way to have the seam mail component take a cert param or something so I can just check the certs into CVS and all the developers don't have to touch their jdk?  That would be really slick(I just prefer the environments to be mostly automated so people can checkout and start working with no config).
                thanks,
                dean

                • 5. Re: seam mail + SSL + ca-cert.org
                  deanhiller2000

                  doesn't the cacert ask you for a keystore password?  I could not seem to find this on the cacert site(but then when I looked on their site, they import it into other tools/systems without such a password).  Why is java the only one asking for a password(and requiring the password to be more than 6 characters too)???


                  how do I import those crts?
                  thanks,
                  dean

                  • 6. Re: seam mail + SSL + ca-cert.org
                    kapitanpetko

                    Have a look at the 'javax.net.ssl.trustStore' and 'javax.net.ssl.trustStorePassword' system properties.