Examples of SslConfiguration


Examples of ch.qos.logback.core.net.ssl.SSLConfiguration

   * @return SSL configuration; if no SSL configuration was provided
   *    a default configuration is returned
   */
  public SSLConfiguration getSsl() {
    if (ssl == null) {
      ssl = new SSLConfiguration();
    }
    return ssl;
  }
View Full Code Here

Examples of ch.qos.logback.core.net.ssl.SSLConfiguration

   * @return SSL configuration; if no configuration has been set, a
   *    default configuration is returned
   */
  public SSLConfiguration getSsl() {
    if (ssl == null) {
      ssl = new SSLConfiguration();
    }
    return ssl;
  }
View Full Code Here

Examples of com.cloudhopper.smpp.ssl.SslConfiguration

        logger.info("New channel from [{}]", channelName);
        Thread.currentThread().setName(currentThreadName);

  // add SSL handler
        if (server.getConfiguration().isUseSsl()) {
      SslConfiguration sslConfig = server.getConfiguration().getSslConfiguration();
      if (sslConfig == null) throw new IllegalStateException("sslConfiguration must be set");
      SslContextFactory factory = new SslContextFactory(sslConfig);
      SSLEngine sslEngine = factory.newSslEngine();
      sslEngine.setUseClientMode(false);
      channel.getPipeline().addLast(SmppChannelConstants.PIPELINE_SESSION_SSL_NAME, new SslHandler(sslEngine));
View Full Code Here

Examples of com.cloudhopper.smpp.ssl.SslConfiguration

    protected DefaultSmppSession createSession(Channel channel, SmppSessionConfiguration config, SmppSessionHandler sessionHandler) throws SmppTimeoutException, SmppChannelException, InterruptedException {
        DefaultSmppSession session = new DefaultSmppSession(SmppSession.Type.CLIENT, config, channel, sessionHandler, monitorExecutor);

  // add SSL handler
        if (config.isUseSsl()) {
      SslConfiguration sslConfig = config.getSslConfiguration();
      if (sslConfig == null) throw new IllegalStateException("sslConfiguration must be set");
      try {
    SslContextFactory factory = new SslContextFactory(sslConfig);
    SSLEngine sslEngine = factory.newSslEngine();
    sslEngine.setUseClientMode(true);
View Full Code Here

Examples of com.cloudhopper.smpp.ssl.SslConfiguration

        return windowWaitTimeout;
    }

    public void setUseSsl(boolean value) {
  // By default, make an SslConfiguration that will trust everything.
  if (getSslConfiguration() == null) setSslConfiguration(new SslConfiguration());
  this.useSsl = value;
    }
View Full Code Here

Examples of io.fathom.http.SslConfiguration

    }

    private HttpClient getHttpClient(CertificateAndKey certificateAndKey) {
        SimpleClientCertificateKeyManager keyManager = new SimpleClientCertificateKeyManager(certificateAndKey);

        SslConfiguration sslConfiguration = getHttpClient().getSslConfiguration().copyWithNewKeyManager(keyManager);
        HttpClient httpClient = getHttpClient().withSsl(sslConfiguration);
        return httpClient;
    }
View Full Code Here

Examples of org.apache.ftpserver.ssl.SslConfiguration

    private SslConfiguration getSslConfiguration() {
        DataConnectionConfiguration dataCfg = session.getListener()
                .getDataConnectionConfiguration();

        SslConfiguration configuration = dataCfg.getSslConfiguration();

        // fall back if no configuration has been provided on the data connection config
        if (configuration == null) {
            configuration = session.getListener().getSslConfiguration();
        }
View Full Code Here

Examples of org.apache.ftpserver.ssl.SslConfiguration

            if (secure) {
                LOG
                        .debug(
                                "Opening SSL passive data connection on address \"{}\" and port {}",
                                address, passivePort);
                SslConfiguration ssl = getSslConfiguration();
                if (ssl == null) {
                    throw new DataConnectionException(
                            "Data connection SSL required but not configured.");
                }
View Full Code Here

Examples of org.apache.ftpserver.ssl.SslConfiguration

                .getDataConnectionConfiguration();
        try {
            if (!passive) {
                if (secure) {
                    LOG.debug("Opening secure active data connection");
                    SslConfiguration ssl = getSslConfiguration();
                    if (ssl == null) {
                        throw new FtpException(
                                "Data connection SSL not configured");
                    }

                    // get socket factory
                    SSLSocketFactory socFactory = ssl.getSocketFactory();

                    // create socket
                    SSLSocket ssoc = (SSLSocket) socFactory.createSocket();
                    ssoc.setUseClientMode(false);

                    // initialize socket
                    if (ssl.getEnabledCipherSuites() != null) {
                        ssoc.setEnabledCipherSuites(ssl.getEnabledCipherSuites());
                    }
                    dataSoc = ssoc;
                } else {
                    LOG.debug("Opening active data connection");
                    dataSoc = new Socket();
                }

                dataSoc.setReuseAddress(true);

                InetAddress localAddr = resolveAddress(dataConfig
                        .getActiveLocalAddress());

                // if no local address has been configured, make sure we use the same as the client connects from
                if(localAddr == null) {
                    localAddr = ((InetSocketAddress)session.getLocalAddress()).getAddress();
                }      

                SocketAddress localSocketAddress = new InetSocketAddress(localAddr, dataConfig.getActiveLocalPort());
               
                LOG.debug("Binding active data connection to {}", localSocketAddress);
                dataSoc.bind(localSocketAddress);

                dataSoc.connect(new InetSocketAddress(address, port));
            } else {

                if (secure) {
                    LOG.debug("Opening secure passive data connection");
                    // this is where we wrap the unsecured socket as a SSLSocket. This is
                    // due to the JVM bug described in FTPSERVER-241.

                    // get server socket factory
                    SslConfiguration ssl = getSslConfiguration();
                   
                    // we've already checked this, but let's do it again
                    if (ssl == null) {
                        throw new FtpException(
                                "Data connection SSL not configured");
                    }

                    SSLSocketFactory ssocketFactory = ssl.getSocketFactory();

                    Socket serverSocket = servSoc.accept();

                    SSLSocket sslSocket = (SSLSocket) ssocketFactory
                            .createSocket(serverSocket, serverSocket
                                    .getInetAddress().getHostAddress(),
                                    serverSocket.getPort(), true);
                    sslSocket.setUseClientMode(false);

                    // initialize server socket
                    if (ssl.getClientAuth() == ClientAuth.NEED) {
                        sslSocket.setNeedClientAuth(true);
                    } else if (ssl.getClientAuth() == ClientAuth.WANT) {
                        sslSocket.setWantClientAuth(true);
                    }

                    if (ssl.getEnabledCipherSuites() != null) {
                        sslSocket.setEnabledCipherSuites(ssl
                                .getEnabledCipherSuites());
                    }

                    dataSoc = sslSocket;
                } else {
View Full Code Here

Examples of org.apache.ftpserver.ssl.SslConfiguration

        if (StringUtils.hasText(element.getAttribute("port"))) {
            factoryBuilder.addPropertyValue("port", Integer.valueOf(element
                    .getAttribute("port")));
        }

        SslConfiguration ssl = parseSsl(element);
        if (ssl != null) {
            factoryBuilder.addPropertyValue("sslConfiguration", ssl);
        }

        Element dataConElm = SpringUtil.getChildElement(element,
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.