Logo Search packages:      
Sourcecode: fex version File versions  Download package

final SSLSocketFactory fix::HttpClient::getSocketFactory (  )  [inline]

Returns a SSL Factory instance that accepts all server certificates. use:

 SSLSocket sock = (SSLSocket) getSocketFactory.createSocket(host, port);

An SSL-specific socket factory.

Definition at line 240 of file HttpClient.java.

References fix::ErrorWindow::setMess().

Referenced by httpsConnect().

            if (sslSocketFactory == null) {
                  try {
                        TrustManager[] tm = new TrustManager[] { new NaiveTrustManager() };
                        SSLContext context = SSLContext.getInstance("SSL");
                        context.init(new KeyManager[0], tm, new SecureRandom());

                        sslSocketFactory = (SSLSocketFactory)context.getSocketFactory();

                  } catch (KeyManagementException e) {
                        er.setMess("No SSL algorithm support: ", e);
                  } catch (NoSuchAlgorithmException e) {
                        er.setMess("Exception when setting up the Naive key management.", e);
            return sslSocketFactory;

Generated by  Doxygen 1.6.0   Back to index