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


Java LdapServer.setKeystoreFile方法代码示例

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


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

示例1: afterPropertiesSet

import org.apache.directory.server.ldap.LdapServer; //导入方法依赖的package包/类
public void afterPropertiesSet() throws Exception {

		if (this.enabledLdapOverSsl && this.keyStoreFile == null) {
			throw new IllegalArgumentException("When LdapOverSsl is enabled, the keyStoreFile property must be set.");
		}

		if (workingDir == null) {
			String apacheWorkDir = System.getProperty("apacheDSWorkDir");

			if (apacheWorkDir == null) {
				apacheWorkDir = createTempDirectory("apacheds-spring-security-");
			}

			setWorkingDirectory(new File(apacheWorkDir));
		}

		server = new LdapServer();

		// AbstractLdapIntegrationTests assume IPv4, so we specify the same here
		TcpTransport transport = new TcpTransport(port);

		if (enabledLdapOverSsl) {
			transport.setEnableSSL(true);
			server.setKeystoreFile(this.keyStoreFile.getAbsolutePath());
			server.setCertificatePassword(this.keyStorePassword);
		}

		server.setTransports(transport);
		server.setDirectoryService(service);
		start();
	}
 
开发者ID:spring-cloud,项目名称:spring-cloud-dataflow,代码行数:32,代码来源:ApacheDSContainerWithSecurity.java

示例2: addTcpServer

import org.apache.directory.server.ldap.LdapServer; //导入方法依赖的package包/类
/**
 * Adds a TCP server to the directory service.
 *
 * Note: The TCP server is not started until start() is called on this Builder.
 *
 * @param serviceName - The name of this server.
 * @param hostName - The host name to listen on.
 * @param port - The port to listen on.
 * @return This Builder for subsequent changes.
 */
public Builder addTcpServer(final String serviceName, final String hostName, final int port, final String keyStore, final String keyStorePassword) throws URISyntaxException {
    assertNotStarted();
    if (directoryService == null) {
        throw new IllegalStateException("The Directory service has not been created.");
    }

    LdapServer server = new LdapServer();
    server.setServiceName(serviceName);
    Transport ldaps = new TcpTransport( hostName, port, 3, 5 );
    ldaps.enableSSL(true);
    server.addTransports(ldaps);
    server.setKeystoreFile(getClass().getResource(keyStore).getFile());
    server.setCertificatePassword(keyStorePassword);
    server.setDirectoryService(directoryService);
    servers.add(server);

    return this;
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:29,代码来源:LdapService.java


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