gpt4 book ai didi

org.xnio.ssl.XnioSsl.openSslConnection()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-25 03:35:05 25 4
gpt4 key购买 nike

本文整理了Java中org.xnio.ssl.XnioSsl.openSslConnection()方法的一些代码示例,展示了XnioSsl.openSslConnection()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XnioSsl.openSslConnection()方法的具体详情如下:
包路径:org.xnio.ssl.XnioSsl
类名称:XnioSsl
方法名:openSslConnection

XnioSsl.openSslConnection介绍

[英]Create an SSL connection to a remote host.
[中]创建到远程主机的SSL连接。

代码示例

代码示例来源:origin: wildfly/wildfly

/**
 * Create an SSL connection to a remote host.
 *
 * @param ioThread the IO Thread to use
 * @param destination the destination connection address
 * @param openListener the initial open-connection listener
 * @param bindListener the bind listener
 * @param optionMap the option map
 * @return the SSL connection
 */
public IoFuture<SslConnection> openSslConnection(final XnioIoThread ioThread, final InetSocketAddress destination, final ChannelListener<? super SslConnection> openListener, final ChannelListener<? super BoundChannel> bindListener, final OptionMap optionMap) {
  return openSslConnection(ioThread, ANY_INET_ADDRESS, destination, openListener, bindListener, optionMap);
}

代码示例来源:origin: wildfly/wildfly

/**
 * Create an SSL connection to a remote host.
 *
 * @param worker the worker to use
 * @param destination the destination connection address
 * @param openListener the initial open-connection listener
 * @param optionMap the option map
 *
 * @return the SSL connection
 */
public IoFuture<SslConnection> openSslConnection(XnioWorker worker, InetSocketAddress destination, ChannelListener<? super SslConnection> openListener, OptionMap optionMap) {
  return openSslConnection(worker, ANY_INET_ADDRESS, destination, openListener, null, optionMap);
}

代码示例来源:origin: wildfly/wildfly

/**
 * Create an SSL connection to a remote host.
 *
 * @param ioThread the IO thread to use
 * @param destination the destination connection address
 * @param openListener the initial open-connection listener
 * @param optionMap the option map
 *
 * @return the SSL connection
 */
public IoFuture<SslConnection> openSslConnection(XnioIoThread ioThread, InetSocketAddress destination, ChannelListener<? super SslConnection> openListener, OptionMap optionMap) {
  return openSslConnection(ioThread, ANY_INET_ADDRESS, destination, openListener, null, optionMap);
}

代码示例来源:origin: wildfly/wildfly

/**
 * Create an SSL connection to a remote host.
 *
 * @param worker the worker to use
 * @param destination the destination connection address
 * @param openListener the initial open-connection listener
 * @param bindListener the bind listener
 * @param optionMap the option map
 * @return the SSL connection
 */
public IoFuture<SslConnection> openSslConnection(final XnioWorker worker, final InetSocketAddress destination, final ChannelListener<? super SslConnection> openListener, final ChannelListener<? super BoundChannel> bindListener, final OptionMap optionMap) {
  return openSslConnection(worker, ANY_INET_ADDRESS, destination, openListener, bindListener, optionMap);
}

代码示例来源:origin: wildfly/wildfly

/**
 * Create an SSL connection to a remote host.
 *
 * @param worker the worker to use
 * @param bindAddress the local bind address
 * @param destination the destination connection address
 * @param openListener the initial open-connection listener
 * @param optionMap the option map
 * @return the SSL connection
 */
public IoFuture<SslConnection> openSslConnection(final XnioWorker worker, final InetSocketAddress bindAddress, final InetSocketAddress destination, final ChannelListener<? super SslConnection> openListener, final OptionMap optionMap) {
  return openSslConnection(worker, bindAddress, destination, openListener, null, optionMap);
}

代码示例来源:origin: wildfly/wildfly

/**
 * Create an SSL connection to a remote host.
 *
 * @param ioThread the IO Thread to use
 * @param bindAddress the local bind address
 * @param destination the destination connection address
 * @param openListener the initial open-connection listener
 * @param optionMap the option map
 * @return the SSL connection
 */
public IoFuture<SslConnection> openSslConnection(final XnioIoThread ioThread, final InetSocketAddress bindAddress, final InetSocketAddress destination, final ChannelListener<? super SslConnection> openListener, final OptionMap optionMap) {
  return openSslConnection(ioThread, bindAddress, destination, openListener, null, optionMap);
}

代码示例来源:origin: wildfly/wildfly

@Override
public void connect(final ClientCallback<ClientConnection> listener, InetSocketAddress bindAddress, final URI uri, final XnioIoThread ioThread, final XnioSsl ssl, final ByteBufferPool bufferPool, final OptionMap options) {
  if (ssl == null) {
    listener.failed(UndertowMessages.MESSAGES.sslWasNull());
    return;
  }
  if(bindAddress == null) {
    OptionMap tlsOptions = OptionMap.builder().addAll(options).set(Options.SSL_STARTTLS, true).getMap();
    ssl.openSslConnection(ioThread, new InetSocketAddress(uri.getHost(), uri.getPort() == -1 ? 443 : uri.getPort()), createOpenListener(listener, uri, ssl, bufferPool, tlsOptions), options).addNotifier(createNotifier(listener), null);
  } else {
    ssl.openSslConnection(ioThread, bindAddress, new InetSocketAddress(uri.getHost(), uri.getPort() == -1 ? 443 : uri.getPort()), createOpenListener(listener, uri, ssl, bufferPool, options), options).addNotifier(createNotifier(listener), null);
  }
}

代码示例来源:origin: wildfly/wildfly

@Override
public void connect(final ClientCallback<ClientConnection> listener, InetSocketAddress bindAddress, final URI uri, final XnioWorker worker, final XnioSsl ssl, final ByteBufferPool bufferPool, final OptionMap options) {
  if (ssl == null) {
    listener.failed(UndertowMessages.MESSAGES.sslWasNull());
    return;
  }
  OptionMap tlsOptions = OptionMap.builder().addAll(options).set(Options.SSL_STARTTLS, true).getMap();
  if(bindAddress == null) {
    ssl.openSslConnection(worker, new InetSocketAddress(uri.getHost(), uri.getPort() == -1 ? 443 : uri.getPort()), createOpenListener(listener, uri, ssl, bufferPool, tlsOptions), tlsOptions).addNotifier(createNotifier(listener), null);
  } else {
    ssl.openSslConnection(worker, bindAddress, new InetSocketAddress(uri.getHost(), uri.getPort() == -1 ? 443 : uri.getPort()), createOpenListener(listener, uri, ssl, bufferPool, tlsOptions), tlsOptions).addNotifier(createNotifier(listener), null);
  }
}

代码示例来源:origin: wildfly/wildfly

@Override
public void connect(ClientCallback<ClientConnection> listener, InetSocketAddress bindAddress, URI uri, XnioIoThread ioThread, XnioSsl ssl, ByteBufferPool bufferPool, OptionMap options) {
  if (uri.getScheme().equals("https")) {
    if (ssl == null) {
      listener.failed(UndertowMessages.MESSAGES.sslWasNull());
      return;
    }
    OptionMap tlsOptions = OptionMap.builder().addAll(options).set(Options.SSL_STARTTLS, true).getMap();
    if (bindAddress == null) {
      ssl.openSslConnection(ioThread, new InetSocketAddress(uri.getHost(), uri.getPort() == -1 ? 443 : uri.getPort()), createOpenListener(listener, bufferPool, tlsOptions, uri), tlsOptions).addNotifier(createNotifier(listener), null);
    } else {
      ssl.openSslConnection(ioThread, bindAddress, new InetSocketAddress(uri.getHost(), uri.getPort() == -1 ? 443 : uri.getPort()), createOpenListener(listener, bufferPool, tlsOptions, uri), tlsOptions).addNotifier(createNotifier(listener), null);
    }
  } else {
    if (bindAddress == null) {
      ioThread.openStreamConnection(new InetSocketAddress(uri.getHost(), uri.getPort() == -1 ? 80 : uri.getPort()), createOpenListener(listener, bufferPool, options, uri), options).addNotifier(createNotifier(listener), null);
    } else {
      ioThread.openStreamConnection(bindAddress, new InetSocketAddress(uri.getHost(), uri.getPort() == -1 ? 80 : uri.getPort()), createOpenListener(listener, bufferPool, options, uri), null, options).addNotifier(createNotifier(listener), null);
    }
  }
}

代码示例来源:origin: wildfly/wildfly

@Override
public void connect(ClientCallback<ClientConnection> listener, InetSocketAddress bindAddress, URI uri, XnioWorker worker, XnioSsl ssl, ByteBufferPool bufferPool, OptionMap options) {
  if (uri.getScheme().equals("https")) {
    if (ssl == null) {
      listener.failed(UndertowMessages.MESSAGES.sslWasNull());
      return;
    }
    OptionMap tlsOptions = OptionMap.builder().addAll(options).set(Options.SSL_STARTTLS, true).getMap();
    if (bindAddress == null) {
      ssl.openSslConnection(worker, new InetSocketAddress(uri.getHost(), uri.getPort() == -1 ? 443 : uri.getPort()), createOpenListener(listener, bufferPool, tlsOptions, uri), tlsOptions).addNotifier(createNotifier(listener), null);
    } else {
      ssl.openSslConnection(worker, bindAddress, new InetSocketAddress(uri.getHost(), uri.getPort() == -1 ? 443 : uri.getPort()), createOpenListener(listener, bufferPool, tlsOptions, uri), tlsOptions).addNotifier(createNotifier(listener), null);
    }
  } else {
    if (bindAddress == null) {
      worker.openStreamConnection(new InetSocketAddress(uri.getHost(), uri.getPort() == -1 ? 80 : uri.getPort()), createOpenListener(listener, bufferPool, options, uri), options).addNotifier(createNotifier(listener), null);
    } else {
      worker.openStreamConnection(bindAddress, new InetSocketAddress(uri.getHost(), uri.getPort() == -1 ? 80 : uri.getPort()), createOpenListener(listener, bufferPool, options, uri), null, options).addNotifier(createNotifier(listener), null);
    }
  }
}

代码示例来源:origin: wildfly/wildfly

private IoFuture<T> doUpgrade() {
  InetSocketAddress address = new InetSocketAddress(uri.getHost(), uri.getPort());
  final ChannelListener<StreamConnection> connectListener = new ConnectionOpenListener();
  final String scheme = uri.getScheme();
  if (scheme.equals("http")) {
    if (bindAddress == null) {
      worker.openStreamConnection(address, connectListener, bindListener, optionMap).addNotifier(new FailureNotifier(), null);
    } else {
      worker.openStreamConnection(bindAddress, address, connectListener, bindListener, optionMap).addNotifier(new FailureNotifier(), null);
    }
  } else if (scheme.equals("https")) {
    if (ssl == null) {
      throw msg.missingSslProvider();
    }
    if (bindAddress == null) {
      ssl.openSslConnection(worker, address, connectListener, bindListener, optionMap).addNotifier(new FailureNotifier(), null);
    } else {
      ssl.openSslConnection(worker, bindAddress, address, connectListener, bindListener, optionMap).addNotifier(new FailureNotifier(), null);
    }
  } else {
    throw msg.invalidURLScheme(scheme);
  }
  return future.getIoFuture();
}

代码示例来源:origin: org.jboss.eap/wildfly-client-all

/**
 * Create an SSL connection to a remote host.
 *
 * @param worker the worker to use
 * @param destination the destination connection address
 * @param openListener the initial open-connection listener
 * @param optionMap the option map
 *
 * @return the SSL connection
 */
public IoFuture<SslConnection> openSslConnection(XnioWorker worker, InetSocketAddress destination, ChannelListener<? super SslConnection> openListener, OptionMap optionMap) {
  return openSslConnection(worker, ANY_INET_ADDRESS, destination, openListener, null, optionMap);
}

代码示例来源:origin: org.jboss.eap/wildfly-client-all

/**
 * Create an SSL connection to a remote host.
 *
 * @param ioThread the IO Thread to use
 * @param destination the destination connection address
 * @param openListener the initial open-connection listener
 * @param bindListener the bind listener
 * @param optionMap the option map
 * @return the SSL connection
 */
public IoFuture<SslConnection> openSslConnection(final XnioIoThread ioThread, final InetSocketAddress destination, final ChannelListener<? super SslConnection> openListener, final ChannelListener<? super BoundChannel> bindListener, final OptionMap optionMap) {
  return openSslConnection(ioThread, ANY_INET_ADDRESS, destination, openListener, bindListener, optionMap);
}

代码示例来源:origin: org.jboss.eap/wildfly-client-all

/**
 * Create an SSL connection to a remote host.
 *
 * @param ioThread the IO Thread to use
 * @param bindAddress the local bind address
 * @param destination the destination connection address
 * @param openListener the initial open-connection listener
 * @param optionMap the option map
 * @return the SSL connection
 */
public IoFuture<SslConnection> openSslConnection(final XnioIoThread ioThread, final InetSocketAddress bindAddress, final InetSocketAddress destination, final ChannelListener<? super SslConnection> openListener, final OptionMap optionMap) {
  return openSslConnection(ioThread, bindAddress, destination, openListener, null, optionMap);
}

代码示例来源:origin: org.jboss.eap/wildfly-client-all

/**
 * Create an SSL connection to a remote host.
 *
 * @param ioThread the IO thread to use
 * @param destination the destination connection address
 * @param openListener the initial open-connection listener
 * @param optionMap the option map
 *
 * @return the SSL connection
 */
public IoFuture<SslConnection> openSslConnection(XnioIoThread ioThread, InetSocketAddress destination, ChannelListener<? super SslConnection> openListener, OptionMap optionMap) {
  return openSslConnection(ioThread, ANY_INET_ADDRESS, destination, openListener, null, optionMap);
}

代码示例来源:origin: org.jboss.eap/wildfly-client-all

/**
 * Create an SSL connection to a remote host.
 *
 * @param worker the worker to use
 * @param destination the destination connection address
 * @param openListener the initial open-connection listener
 * @param bindListener the bind listener
 * @param optionMap the option map
 * @return the SSL connection
 */
public IoFuture<SslConnection> openSslConnection(final XnioWorker worker, final InetSocketAddress destination, final ChannelListener<? super SslConnection> openListener, final ChannelListener<? super BoundChannel> bindListener, final OptionMap optionMap) {
  return openSslConnection(worker, ANY_INET_ADDRESS, destination, openListener, bindListener, optionMap);
}

代码示例来源:origin: io.undertow/undertow-core

@Override
public void connect(final ClientCallback<ClientConnection> listener, InetSocketAddress bindAddress, final URI uri, final XnioWorker worker, final XnioSsl ssl, final ByteBufferPool bufferPool, final OptionMap options) {
  if (ssl == null) {
    listener.failed(UndertowMessages.MESSAGES.sslWasNull());
    return;
  }
  OptionMap tlsOptions = OptionMap.builder().addAll(options).set(Options.SSL_STARTTLS, true).getMap();
  if(bindAddress == null) {
    ssl.openSslConnection(worker, new InetSocketAddress(uri.getHost(), uri.getPort() == -1 ? 443 : uri.getPort()), createOpenListener(listener, uri, ssl, bufferPool, tlsOptions), tlsOptions).addNotifier(createNotifier(listener), null);
  } else {
    ssl.openSslConnection(worker, bindAddress, new InetSocketAddress(uri.getHost(), uri.getPort() == -1 ? 443 : uri.getPort()), createOpenListener(listener, uri, ssl, bufferPool, tlsOptions), tlsOptions).addNotifier(createNotifier(listener), null);
  }
}

代码示例来源:origin: io.undertow/undertow-core

@Override
public void connect(final ClientCallback<ClientConnection> listener, InetSocketAddress bindAddress, final URI uri, final XnioIoThread ioThread, final XnioSsl ssl, final ByteBufferPool bufferPool, final OptionMap options) {
  if (ssl == null) {
    listener.failed(UndertowMessages.MESSAGES.sslWasNull());
    return;
  }
  if(bindAddress == null) {
    OptionMap tlsOptions = OptionMap.builder().addAll(options).set(Options.SSL_STARTTLS, true).getMap();
    ssl.openSslConnection(ioThread, new InetSocketAddress(uri.getHost(), uri.getPort() == -1 ? 443 : uri.getPort()), createOpenListener(listener, uri, ssl, bufferPool, tlsOptions), options).addNotifier(createNotifier(listener), null);
  } else {
    ssl.openSslConnection(ioThread, bindAddress, new InetSocketAddress(uri.getHost(), uri.getPort() == -1 ? 443 : uri.getPort()), createOpenListener(listener, uri, ssl, bufferPool, options), options).addNotifier(createNotifier(listener), null);
  }
}

代码示例来源:origin: org.jboss.eap/wildfly-client-all

@Override
public void connect(final ClientCallback<ClientConnection> listener, InetSocketAddress bindAddress, final URI uri, final XnioIoThread ioThread, final XnioSsl ssl, final ByteBufferPool bufferPool, final OptionMap options) {
  if (ssl == null) {
    listener.failed(UndertowMessages.MESSAGES.sslWasNull());
    return;
  }
  if(bindAddress == null) {
    OptionMap tlsOptions = OptionMap.builder().addAll(options).set(Options.SSL_STARTTLS, true).getMap();
    ssl.openSslConnection(ioThread, new InetSocketAddress(uri.getHost(), uri.getPort() == -1 ? 443 : uri.getPort()), createOpenListener(listener, uri, ssl, bufferPool, tlsOptions), options).addNotifier(createNotifier(listener), null);
  } else {
    ssl.openSslConnection(ioThread, bindAddress, new InetSocketAddress(uri.getHost(), uri.getPort() == -1 ? 443 : uri.getPort()), createOpenListener(listener, uri, ssl, bufferPool, options), options).addNotifier(createNotifier(listener), null);
  }
}

代码示例来源:origin: org.jboss.eap/wildfly-client-all

@Override
public void connect(final ClientCallback<ClientConnection> listener, InetSocketAddress bindAddress, final URI uri, final XnioWorker worker, final XnioSsl ssl, final ByteBufferPool bufferPool, final OptionMap options) {
  if (ssl == null) {
    listener.failed(UndertowMessages.MESSAGES.sslWasNull());
    return;
  }
  OptionMap tlsOptions = OptionMap.builder().addAll(options).set(Options.SSL_STARTTLS, true).getMap();
  if(bindAddress == null) {
    ssl.openSslConnection(worker, new InetSocketAddress(uri.getHost(), uri.getPort() == -1 ? 443 : uri.getPort()), createOpenListener(listener, uri, ssl, bufferPool, tlsOptions), tlsOptions).addNotifier(createNotifier(listener), null);
  } else {
    ssl.openSslConnection(worker, bindAddress, new InetSocketAddress(uri.getHost(), uri.getPort() == -1 ? 443 : uri.getPort()), createOpenListener(listener, uri, ssl, bufferPool, tlsOptions), tlsOptions).addNotifier(createNotifier(listener), null);
  }
}

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com