Package org.apache.sshd.server
Class ServerBuilder
- java.lang.Object
-
- org.apache.sshd.common.BaseBuilder<SshServer,ServerBuilder>
-
- org.apache.sshd.server.ServerBuilder
-
- All Implemented Interfaces:
java.util.function.Supplier<SshServer>
,ObjectBuilder<SshServer>
public class ServerBuilder extends BaseBuilder<SshServer,ServerBuilder>
SshServer builder
-
-
Field Summary
Fields Modifier and Type Field Description static java.util.List<ChannelFactory>
DEFAULT_CHANNEL_FACTORIES
static java.util.List<CompressionFactory>
DEFAULT_COMPRESSION_FACTORIES
static java.util.List<RequestHandler<ConnectionService>>
DEFAULT_GLOBAL_REQUEST_HANDLERS
static KeyboardInteractiveAuthenticator
DEFAULT_INTERACTIVE_AUTHENTICATOR
static KexExtensionHandler
DEFAULT_KEX_EXTENSION_HANDLER
static PublickeyAuthenticator
DEFAULT_PUBLIC_KEY_AUTHENTICATOR
static java.util.List<BuiltinCiphers>
DEFAULT_SERVER_CIPHERS_PREFERENCE
Default list of ciphers for a server.static java.util.function.Function<DHFactory,KeyExchangeFactory>
DH2KEX
protected KeyboardInteractiveAuthenticator
interactiveAuthenticator
protected PublickeyAuthenticator
pubkeyAuthenticator
-
Fields inherited from class org.apache.sshd.common.BaseBuilder
channelFactories, channelStreamPacketWriterResolver, cipherFactories, compressionFactories, DEFAULT_CIPHERS_PREFERENCE, DEFAULT_FILE_SYSTEM_FACTORY, DEFAULT_FORWARDER_FACTORY, DEFAULT_FORWARDING_FILTER, DEFAULT_KEX_PREFERENCE, DEFAULT_MAC_PREFERENCE, DEFAULT_SIGNATURE_PREFERENCE, DEFAULT_UNKNOWN_CHANNEL_REFERENCE_HANDLER, factory, fileSystemFactory, forwarderFactory, forwardingFilter, globalRequestHandlers, kexExtensionHandler, keyExchangeFactories, macFactories, randomFactory, signatureFactories, unknownChannelReferenceHandler
-
-
Constructor Summary
Constructors Constructor Description ServerBuilder()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description SshServer
build(boolean isFillWithDefaultValues)
static ServerBuilder
builder()
protected ServerBuilder
fillWithDefaultValues()
ServerBuilder
interactiveAuthenticator(KeyboardInteractiveAuthenticator auth)
ServerBuilder
publickeyAuthenticator(PublickeyAuthenticator auth)
static java.util.List<NamedFactory<Compression>>
setUpDefaultCompressionFactories(boolean ignoreUnsupported)
static java.util.List<KeyExchangeFactory>
setUpDefaultKeyExchanges(boolean ignoreUnsupported)
static java.util.List<NamedFactory<Signature>>
setUpDefaultSignatureFactories(boolean ignoreUnsupported)
-
Methods inherited from class org.apache.sshd.common.BaseBuilder
build, channelFactories, channelStreamPacketWriterResolver, cipherFactories, compressionFactories, factory, fileSystemFactory, forwarderFactory, forwardingFilter, globalRequestHandlers, kexExtensionHandler, keyExchangeFactories, macFactories, me, randomFactory, setUpDefaultCiphers, setUpDefaultMacs, signatureFactories, unknownChannelReferenceHandler
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.sshd.common.util.ObjectBuilder
get
-
-
-
-
Field Detail
-
DH2KEX
public static final java.util.function.Function<DHFactory,KeyExchangeFactory> DH2KEX
-
DEFAULT_CHANNEL_FACTORIES
public static final java.util.List<ChannelFactory> DEFAULT_CHANNEL_FACTORIES
-
DEFAULT_GLOBAL_REQUEST_HANDLERS
public static final java.util.List<RequestHandler<ConnectionService>> DEFAULT_GLOBAL_REQUEST_HANDLERS
-
DEFAULT_PUBLIC_KEY_AUTHENTICATOR
public static final PublickeyAuthenticator DEFAULT_PUBLIC_KEY_AUTHENTICATOR
-
DEFAULT_INTERACTIVE_AUTHENTICATOR
public static final KeyboardInteractiveAuthenticator DEFAULT_INTERACTIVE_AUTHENTICATOR
-
DEFAULT_COMPRESSION_FACTORIES
public static final java.util.List<CompressionFactory> DEFAULT_COMPRESSION_FACTORIES
-
DEFAULT_KEX_EXTENSION_HANDLER
public static final KexExtensionHandler DEFAULT_KEX_EXTENSION_HANDLER
-
DEFAULT_SERVER_CIPHERS_PREFERENCE
public static final java.util.List<BuiltinCiphers> DEFAULT_SERVER_CIPHERS_PREFERENCE
Default list of ciphers for a server. This excludes the AES-CBC ciphers -- OpenSSH has stopped proposing them by default in 2014 (and removed them from the client proposal in 2017, too). CBC is susceptible to padding oracle attacks and other attacks and is thus not recommended anymore.For clients, we do still include the CBC modes to better support connecting with legacy servers.
-
pubkeyAuthenticator
protected PublickeyAuthenticator pubkeyAuthenticator
-
interactiveAuthenticator
protected KeyboardInteractiveAuthenticator interactiveAuthenticator
-
-
Method Detail
-
interactiveAuthenticator
public ServerBuilder interactiveAuthenticator(KeyboardInteractiveAuthenticator auth)
-
publickeyAuthenticator
public ServerBuilder publickeyAuthenticator(PublickeyAuthenticator auth)
-
fillWithDefaultValues
protected ServerBuilder fillWithDefaultValues()
- Overrides:
fillWithDefaultValues
in classBaseBuilder<SshServer,ServerBuilder>
-
build
public SshServer build(boolean isFillWithDefaultValues)
- Overrides:
build
in classBaseBuilder<SshServer,ServerBuilder>
-
setUpDefaultSignatureFactories
public static java.util.List<NamedFactory<Signature>> setUpDefaultSignatureFactories(boolean ignoreUnsupported)
-
setUpDefaultCompressionFactories
public static java.util.List<NamedFactory<Compression>> setUpDefaultCompressionFactories(boolean ignoreUnsupported)
-
setUpDefaultKeyExchanges
public static java.util.List<KeyExchangeFactory> setUpDefaultKeyExchanges(boolean ignoreUnsupported)
- Parameters:
ignoreUnsupported
- Iftrue
then all the default key exchanges are included, regardless of whether they are currently supported by the JCE. Otherwise, only the supported ones out of the list are included- Returns:
- A
List
of the defaultNamedFactory
instances of theKeyExchange
s according to the preference order defined byBaseBuilder.DEFAULT_KEX_PREFERENCE
. Note: the list may be filtered to exclude unsupported JCE key exchanges according to the ignoreUnsupported parameter - See Also:
BuiltinDHFactories.isSupported()
-
builder
public static ServerBuilder builder()
-
-