当前位置: 首页>>代码示例>>Java>>正文


Java SslConfigurationFactory.setClientAuthentication方法代码示例

本文整理汇总了Java中org.apache.ftpserver.ssl.SslConfigurationFactory.setClientAuthentication方法的典型用法代码示例。如果您正苦于以下问题:Java SslConfigurationFactory.setClientAuthentication方法的具体用法?Java SslConfigurationFactory.setClientAuthentication怎么用?Java SslConfigurationFactory.setClientAuthentication使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.ftpserver.ssl.SslConfigurationFactory的用法示例。


在下文中一共展示了SslConfigurationFactory.setClientAuthentication方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createSslConfiguration

import org.apache.ftpserver.ssl.SslConfigurationFactory; //导入方法依赖的package包/类
protected SslConfigurationFactory createSslConfiguration() {
    // comment in, if you have trouble with SSL
    // System.setProperty("javax.net.debug", "all");
    
    SslConfigurationFactory sslConfigFactory = new SslConfigurationFactory();
    sslConfigFactory.setSslProtocol(getAuthValue());
    
    sslConfigFactory.setKeystoreFile(FTPSERVER_KEYSTORE);
    sslConfigFactory.setKeystoreType("JKS");
    sslConfigFactory.setKeystoreAlgorithm("SunX509");
    sslConfigFactory.setKeystorePassword(FTPSERVER_KEYSTORE_PASSWORD);
    sslConfigFactory.setKeyPassword(FTPSERVER_KEYSTORE_PASSWORD);
    
    sslConfigFactory.setClientAuthentication(getClientAuth());
    
    if (Boolean.valueOf(getClientAuth())) {
        sslConfigFactory.setTruststoreFile(FTPSERVER_KEYSTORE);
        sslConfigFactory.setTruststoreType("JKS");
        sslConfigFactory.setTruststoreAlgorithm("SunX509");
        sslConfigFactory.setTruststorePassword(FTPSERVER_KEYSTORE_PASSWORD);            
    }

    return sslConfigFactory;
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:25,代码来源:FtpsServerTestSupport.java

示例2: configureSSL

import org.apache.ftpserver.ssl.SslConfigurationFactory; //导入方法依赖的package包/类
private ListenerFactory configureSSL() {
    ListenerFactory listener = new ListenerFactory();
    listener.setServerAddress("127.0.0.1");
    listener.setPort(PORT);

    SslConfigurationFactory ssl = new SslConfigurationFactory();
    ssl.setKeystoreFile(SERVER_SSL_KEY_TRUST_STORE);
    ssl.setKeyPassword(SERVER_SSL_KEY_PASSWD);
    ssl.setKeystorePassword(SERVER_SSL_STORE_PASSWD);
    ssl.setTruststoreFile(SERVER_SSL_KEY_TRUST_STORE);
    ssl.setTruststorePassword(SERVER_SSL_STORE_PASSWD);
    ssl.setClientAuthentication("NEED");

    SslConfiguration sslConfig = ssl.createSslConfiguration();

    listener.setSslConfiguration(sslConfig);
    listener.setImplicitSsl(true);
    DataConnectionConfigurationFactory dataConfigFactory = new DataConnectionConfigurationFactory();
    dataConfigFactory.setImplicitSsl(true);

    listener.setDataConnectionConfiguration(dataConfigFactory.createDataConnectionConfiguration());

    return listener;
}
 
开发者ID:jboss-integration,项目名称:fuse-bxms-integ,代码行数:25,代码来源:CamelFtpsTest.java


注:本文中的org.apache.ftpserver.ssl.SslConfigurationFactory.setClientAuthentication方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。