STunnel and Openfire

I am looking to use stunnel to correct sparkwebs inability to use ssl. in doing a search it looks like people have done it but there are no hints as to how they did it.

I have experimented and I can use stunnel to go from a client ssl connection to a server non-ssl connection, I can also go from a client non-ssl connection to a server ssl connection. So I know I am able to do what I want with stunnel.

whenever I get it setup to take non-ssl and redirect to ssl and try and login to sparkweb I get the following error:

2009.01.03 19:25:09 Closing session due to exception: (SOCKET, R: /10.12.1.32:52534, L: /10.12.1.24:5222, S: 0.0.0.0/0.0.0.0:5222)
org.apache.mina.filter.codec.ProtocolDecoderException: java.lang.Exception: Disallowed character (Hexdump: 80 4F 01 03 00 00 36 00 00 00 10 00 00 88 00 00 87 00 00 39 00 00 38 00 00 84 00 00 35 00 00 45 00 00 44 00 00 33 00 00 32 00 00 41 00 00 04 00 00 05 00 00 2F 00 00 16 00 00 13 00 FE FF 00 00 0A 10 59 98 77 C3 E2 20 F3 A4 6C 0B FC 24 50 55 1E)
at org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(ProtocolCodecF ilter.java:170)
at org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(Ab stractIoFilterChain.java:299)
at org.apache.mina.common.support.AbstractIoFilterChain.access$1100(AbstractIoFilt erChain.java:53)
at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.messageReceive d(AbstractIoFilterChain.java:648)
at org.apache.mina.filter.executor.ExecutorFilter.processEvent(ExecutorFilter.java :239)
at org.apache.mina.filter.executor.ExecutorFilter$ProcessEventsRunnable.run(Execut orFilter.java:283)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java: 885)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:51)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.Exception: Disallowed character
at org.jivesoftware.openfire.nio.XMLLightweightParser.read(XMLLightweightParser.ja va:211)
at org.jivesoftware.openfire.nio.XMPPDecoder.doDecode(XMPPDecoder.java:32)
at org.apache.mina.filter.codec.CumulativeProtocolDecoder.decode(CumulativeProtoco lDecoder.java:133)
at org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(ProtocolCodecF ilter.java:163)

any one have any ideas on what I can change to get this working? I would like to use sparkweb but can not use non-ssl.