if (connectivity && method == Method.SSL) {
SSLSocketFactory socketFactory =
(SSLSocketFactory) SSLSocketFactory.getDefault();
try {
SSLSocket socket = (SSLSocket) socketFactory.createSocket();
socket.connect(new InetSocketAddress(hostname, port), 3000);
socket.setSoTimeout(3000);
socket.getInputStream().read();
insertMessage(form, "method",
"Is this server Active Directory Controller?", null);
} catch (SocketTimeoutException e) {