mail.pop3s.socketFactory.class is ignored
-----------------------------------------

                 Key: GERONIMO-4294
                 URL: https://issues.apache.org/jira/browse/GERONIMO-4294
             Project: Geronimo
          Issue Type: Bug
      Security Level: public (Regular issues)
          Components: mail
         Environment: geronimo-javamail_1.4_mail-1.4.jar
IBM JRE 6 SR 1
Windows XP
            Reporter: Dave Rushall


I am attempting to connect to a pop3s store using a custom SSLSocketFactory by 
setting the following in my session properties:

mail.pop3s.socketFactory.class=test.TestSSLSocketFactory

The mail.debug log suggests that the pop3s implementation is ignoring this 
property and is using the default SSLSocketFactory:

pop3s DEBUG: Creating SSL socket using factory javax.net.ssl.SSLSocketFactory

I am appending my TestSSLSocketFactory source. It trivially wraps 
javax.net.ssl.SSLSocketFactory but writes a message to System.out when its 
getDefault() method is used.

-- 8< --

package test;
import java.io.IOException;
import java.net.InetAddress;
import java.net.Socket;
import java.net.UnknownHostException;
import javax.net.ssl.SSLSocketFactory;
public class TestSSLSocketFactory extends SSLSocketFactory {
    SSLSocketFactory socketFactory = (SSLSocketFactory) 
SSLSocketFactory.getDefault();
    public static SSLSocketFactory getDefault() {
        System.out.println("TestSSLSocketFactory.getDefault()");
        return new TestSSLSocketFactory();
    }
    @Override
    public Socket createSocket(String host, int port) throws IOException, 
UnknownHostException {
        return socketFactory.createSocket(host, port);
    }
    @Override
    public Socket createSocket(InetAddress address, int port) throws 
IOException {
        return socketFactory.createSocket(address, port);
    }
    @Override
    public Socket createSocket(String host, int port, InetAddress localHost, 
int localPort) throws IOException, UnknownHostException {
        return socketFactory.createSocket(host, port, localHost, localPort);
    }
    @Override
    public Socket createSocket(InetAddress address, int port, InetAddress 
localAddress, int localPort) throws IOException {
        return socketFactory.createSocket(address, port, localAddress, 
localPort);
    }
    @Override
    public Socket createSocket(Socket s, String host, int port, boolean 
autoClose) throws IOException {
        return socketFactory.createSocket(s, host, port, autoClose);
    }
    @Override
    public String[] getDefaultCipherSuites() {
        return socketFactory.getDefaultCipherSuites();
    }
    @Override
    public String[] getSupportedCipherSuites() {
        return socketFactory.getSupportedCipherSuites();
    }
}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to