Hi, Vished.
If I understood right your intentions you are planning to pass
TLSSocketFactory to java mail to take advantage of ssl for javamail.

It can done by passing name of ssl factory class to javamail using
properties e.g.

props.put("mail.smtp.socketFactory.class","javax.net.ssl.SSLSocketFactory");

Sun recently opened javamail 1.2 sources so we can take a look what happens
there (even though it is possible to guess how it works without looking at
the sun's code):
in com.sun.mail.util.SocketFetcher

Class clsSockFact = Class.forName(sfClass);
// get & invoke the getDefault() method
Method mthGetDefault = clsSockFact.getMethod("getDefault", new Class[]{});
Object o = mthGetDefault.invoke(new Object(), new Object[]{});
// get & invoke the createSocket() method
Class[] mthArgs = new Class[] { java.lang.String.class,  Integer.TYPE };
Method mthCreateSocket =  clsSockFact.getMethod("createSocket", mthArgs);
...

Therefore I think, even if you pass cornerstone's socket factory to javamail
it simply wont work. There are two ways to workaround this
1. as above by passing javax.net.ssl.SSLSocketFactory (don't forget about
jre's truststore)
2. by creating avalonized java mail from ground up :-) which will be great!

Andrei

PS you can get cornerstone from apache cvs repository as described here
http://jakarta.apache.org/site/cvsindex.html

----- Original Message -----
From: "Vished Kumar" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, August 09, 2002 5:54 PM
Subject: TLSSocketFactory Implementation


> Hello,
>    Was wondering if I could get access to the TLSSocketFactory
> implementation to use with my JavaMail client to access a secure socket
> connection. I tried looking for the source in the cornerstone section of
> your site, but did not find any downloads. Any help would be greatly
> appreciated.
>
> Thanks,
>
> Vished
>
> ******************************
> Vished Kumar
> Sr. Software Engineer
> Mitratech, Inc.
> 3539 Motor Ave
> Los Angeles, CA 90034
> Email: [EMAIL PROTECTED]
> ******************************
>
>
>
>
> --
> To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>
>



--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to