@Override public Socket wrapSocket(Socket socket) throws IOException { return SocketUtils.wrapSocketInSslContext(socket, m_protocol, m_cipherSuites); } }
public static Socket wrapSocketInSslContext(Socket socket) throws IOException { return wrapSocketInSslContext(socket, null, null); }
public static SSLSocket wrapSocketInSslContext(Socket socket, String protocol) throws IOException { return wrapSocketInSslContext(socket, protocol, null); }
/** * <p>wrapSocket</p> * * @param socket a {@link java.net.Socket} object. * @param useSsl a boolean. * @return a {@link java.net.Socket} object. * @throws java.io.IOException if any. */ protected Socket wrapSocket(Socket socket, boolean useSsl) throws IOException { if (!useSsl) { return socket; } else { // Set this socket to use anonymous Diffie-Hellman ciphers. This removes the authentication // benefits of SSL, but it's how NRPE rolls so we have to play along. return SocketUtils.wrapSocketInSslContext(socket, null, ADH_CIPHER_SUITES); } } }
/** * <p>getWrappedSocket</p> * * @param address a {@link java.net.InetAddress} object. * @param port a int. * @param timeout a int. * @return a {@link java.net.Socket} object. * @throws java.io.IOException if any. */ protected Socket getWrappedSocket(final InetAddress address, final int port, final int timeout) throws IOException { Socket socket = new Socket(); socket.connect(new InetSocketAddress(address, port), timeout); socket.setSoTimeout(timeout); try { return SocketUtils.wrapSocketInSslContext(socket); } catch (final Exception e) { LOG.debug("Unable to wrap socket in SSL.", e); return null; } }
/** * <p>getWrappedSocket</p> * * @param address a {@link java.net.InetAddress} object. * @param port a int. * @param timeout a int. * @return a {@link java.net.Socket} object. * @throws java.io.IOException if any. */ protected Socket getWrappedSocket(final InetAddress address, final int port, final int timeout) throws IOException { Socket socket = new Socket(); socket.connect(new InetSocketAddress(address, port), timeout); socket.setSoTimeout(timeout); try { return SocketUtils.wrapSocketInSslContext(socket); } catch (final Exception e) { LOG.debug("Unable to wrap socket in SSL.", e); return null; } }
/** * <p>wrapSocket</p> * * @param socket a {@link java.net.Socket} object. * @param hostAddress a {@link java.lang.String} object. * @param port a int. * @return a {@link java.net.Socket} object. * @throws java.lang.Exception if any. */ @Override public Socket wrapSocket(final Socket socket) throws IOException { if (!isUseSsl()) { return socket; } else { // Set this socket to use anonymous Diffie-Hellman ciphers. This removes the authentication // benefits of SSL, but it's how NRPE rolls so we have to play along. return SocketUtils.wrapSocketInSslContext(socket, null, ADH_CIPHER_SUITES); } }
/** * <p>wrapSocket</p> * * @param socket a {@link java.net.Socket} object. * @param hostAddress a {@link java.lang.String} object. * @param port a int. * @return a {@link java.net.Socket} object. * @throws java.lang.Exception if any. */ @Override public Socket wrapSocket(final Socket socket) throws IOException { if (!isUseSsl()) { return socket; } else { // Set this socket to use anonymous Diffie-Hellman ciphers. This removes the authentication // benefits of SSL, but it's how NRPE rolls so we have to play along. return SocketUtils.wrapSocketInSslContext(socket, null, ADH_CIPHER_SUITES); } }
socket.setSoTimeout(tracker.getSoTimeout()); LOG.debug("Connected to host: {} on port: {}", ipAddr, port); SSLSocket sslSocket = SocketUtils.wrapSocketInSslContext(socket, null, null);