How to enable certificate-based client authentication in Apache MINA FTPS server?

691 views Asked by At

I set up an FTPS server with Apache MINA in which clients cients authenticate via user/password. I now want to force clients to authenticate via an SSL certificate, but I could not find instructions nor examples for this. Anyone can help?

1

There are 1 answers

0
Alberto Anguita On

Got it:

    ListenerFactory factory = new ListenerFactory();
    SslConfigurationFactory ssl = new SslConfigurationFactory();
    ssl.setClientAuthentication("true");
    ssl.setTruststoreFile(new File("trust.jks"));
    ssl.setTruststorePassword("trust-password");
    ssl.setKeystoreFile(new File("certs.jks"));
    ssl.setKeystorePassword("certs-password");
    factory.setSslConfiguration(ssl.createSslConfiguration());
    factory.setImplicitSsl(true);

The server will force clients to connect using a certificate, and will only accept those included in trust.jks.