本文整理汇总了Java中org.eclipse.jetty.server.ssl.SslSocketConnector.setKeyPassword方法的典型用法代码示例。如果您正苦于以下问题:Java SslSocketConnector.setKeyPassword方法的具体用法?Java SslSocketConnector.setKeyPassword怎么用?Java SslSocketConnector.setKeyPassword使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.jetty.server.ssl.SslSocketConnector
的用法示例。
在下文中一共展示了SslSocketConnector.setKeyPassword方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: buildSslListener
import org.eclipse.jetty.server.ssl.SslSocketConnector; //导入方法依赖的package包/类
/**
* Creates a SSLListener with all the default options. The listener will use all the default options.
* @param address - The address the listener will listen to.
* @param port - The port the listener will listen to.
* @return - Newly created listener
* @throws UnknownHostException
*/
public static SslSocketConnector buildSslListener(String address, int port) throws UnknownHostException {
int listeners = 0;
if (_server != null) {
listeners = _server.getConnectors().length;
}
SslSocketConnector ssl = new SslSocketConnector();
ssl.setProvider(_secMan.getSecurityProvider());
//ssl.setCipherSuites(_secMan.getSupprtedSSLCipherSuites()); Removed in Jetty 5->6 port.
ssl.setHost(address);
ssl.setPort(port);
ssl.setWantClientAuth(false); // Don't care about client authentication.
ssl.setPassword(KeyStoreProvider.DEFAULT_KEYSTORE_PASSWORD);
ssl.setKeyPassword(KeyStoreProvider.DEFAULT_KEYSTORE_PASSWORD);
ssl.setKeystoreType(KeyStore.getDefaultType());
ssl.setKeystore(KeyStoreProvider.getKeyStoreLocation());
ssl.setName("SSL Listener-" + ++listeners);
return ssl;
}
示例2: getConnector
import org.eclipse.jetty.server.ssl.SslSocketConnector; //导入方法依赖的package包/类
private SocketConnector getConnector() {
if ( sslConfig != null ) {
log.logBasic( BaseMessages.getString( PKG, "WebServer.Log.SslModeUsing" ) );
SslSocketConnector connector = new SslSocketConnector();
connector.setKeystore( sslConfig.getKeyStore() );
connector.setPassword( sslConfig.getKeyStorePassword() );
connector.setKeyPassword( sslConfig.getKeyPassword() );
connector.setKeystoreType( sslConfig.getKeyStoreType() );
return connector;
} else {
return new SocketConnector();
}
}