1 2 Previous Next 28 Replies Latest reply on Apr 2, 2004 4:23 AM by kabirkhan Go to original post
      • 15. Re: TODO: TLS and JBossSX integration
        kabirkhan

        Almost there, just need to change the tests

        • 16. Re: TODO: TLS and JBossSX integration
          kabirkhan

          Almost there, just need to change the tests

          • 17. Re: TODO: TLS and JBossSX integration

            Okay, duh. Thanks, Kab!
            Steve

            • 18. Re: TODO: TLS and JBossSX integration

              I get the same error, it seems:

              19:55:19,028 INFO [STDOUT] java.net.SocketException: Default SSL context init f
              ailed: null
              19:55:19,038 INFO [STDOUT] at javax.net.ssl.DefaultSSLSocketFactory.createS
              ocket(DashoA6275)
              19:55:19,038 INFO [STDOUT] at org.jboss.mail.smtp.handlers.CmdSTARTTLS.hand
              leRequest(CmdSTARTTLS.java:52)
              19:55:19,038 INFO [STDOUT] at org.jboss.mail.smtp.SMTPProtocolInstance.hand
              leRequest(SMTPProtocolInstance.java:151)
              19:55:19,038 INFO [STDOUT] at org.jboss.mail.ServerThread.run(ServerThread.
              java:221)
              19:55:19,038 INFO [STDOUT] at java.lang.Thread.run(Thread.java:534)
              19:55:19,038 ERROR [SMTPProtocolInstance] Handle IO Error
              19:55:19,038 INFO [STDOUT] java.lang.NullPointerException
              19:55:19,038 INFO [STDOUT] at org.jboss.mail.ServerThread.run(ServerThread.
              java:223)
              19:55:19,038 INFO [STDOUT] at java.lang.Thread.run(Thread.java:534)

              • 19. Re: TODO: TLS and JBossSX integration

                Same reason. Not pointing to the right keystore.

                • 20. Re: TODO: TLS and JBossSX integration

                  Okay, I got it going.
                  Phew.
                  Steve

                  • 21. Re: TODO: TLS and JBossSX integration

                    I see this MBean defined in the docs, sample 4, chapter 8. Is this the kind of thing you're looking for, instead of tying it directly to the SMTP MBean?

                    <!-- The SSL domain setup -->




                    chap8.keystore
                    rmi+ssl


                    Then in the SMTP MBean, we'd include something like:

                    java:/jaas/RMI+SSL
                    jboss.security:service=JaasSecurityDomain,domain=RMI+SSL

                    Steve

                    • 22. Re: TODO: TLS and JBossSX integration

                      I started doingn what I mentioned, and I get this error, when trying to add the security domain to the SMTP MBean:

                      21:23:49,274 INFO [ServiceConfigurator] Problem configuring service jboss.mail:
                      type=MailServices,name=SMTP
                      org.jboss.deployment.DeploymentException: No Attribute found with name: Security
                      Domain
                      at org.jboss.system.ServiceConfigurator.configure(ServiceConfigurator.ja
                      va:321)

                      Do I need to add the security domain to the list of if/else in the setProperty helper method in SMTPProtocol class?

                      I guess I'm just figuring that it looks like in JMX it doesn't populate all the properties by default. Which is fine.

                      Steve

                      • 23. Re: TODO: TLS and JBossSX integration
                        kabirkhan

                        I've based the stuff on this example, it is working and once I get the unit test working I'll commit. Should be in a few hours.

                        I added the MBean to jboss-service.xml and as a depends to SMTPProtocol.

                        If you have added the SecurityDomain as an attribute to your MBean you will need to provide getters/setters for it in the MBean interface, and if you've added it to the list of properties you will need to handle it in the helper method. Anyway, should all be ready in an hour or two.

                        Kab

                        • 24. Re: TODO: TLS and JBossSX integration

                          Yeah I added the getters/setters, but it couldn't deal with the data correctly. I'll check it out when you're done.

                          Steve

                          • 25. Re: TODO: TLS and JBossSX integration
                            kabirkhan

                            Got some problems changing the unit tests. They often seem harder to do than the code itself :-(

                            • 26. Re: TODO: TLS and JBossSX integration
                              kabirkhan

                              JaasSecurityManagerService (required by JaasSecurityDomain) makes a call to InitialContext.getNameParser(). This first determines the default InitialContext (i.e. FakeInitialContext) and calls getParser() on the default IC. This was not implemented, causing a StackOverflowError by the repeated recursive calls to getNameParser().

                              I have implemented FakeInitialContext.getNameParser() to return a
                              org.jnp.interfaces.NamingParser instance since this is what was being used when I stepped through the code running normally in JBoss using JBoss-IDE.

                              I'm tidying everything up and will be committing shortly.

                              Cheers,

                              Kab

                              • 27. Re: TODO: TLS and JBossSX integration
                                acoliver

                                It makes sense that they're harder sometimes than the code itself. You're setting up inputs and testing outputs. Often that is a much bigger task than processing the inputs. Its worth it though.

                                • 28. Re: TODO: TLS and JBossSX integration
                                  kabirkhan

                                  Yeah, got there in the end :-) Had to look at quite a lot of stuff in the various modules in JBoss to igure it out, but have learnt a bit from it

                                  1 2 Previous Next