ctx = SSLContext.getInstance("TLS"); } catch (NoSuchAlgorithmException e) { throw new TransportFactoryInitException("JVM does not have proper libraries for TSL"); ctx.init(null, new TrustManager[] {tm}, new java.security.SecureRandom()); } catch (KeyManagementException e) { throw new TransportFactoryInitException("Unable to init SSLContext with TrustManager", e);
ctx = SSLContext.getInstance("TLS"); } catch (NoSuchAlgorithmException e) { throw new TransportFactoryInitException("JVM does not have proper libraries for TSL"); ctx.init(null, new TrustManager[] {tm}, new java.security.SecureRandom()); } catch (KeyManagementException e) { throw new TransportFactoryInitException("Unable to init SSLContext with TrustManager", e);
ctx = SSLContext.getInstance("TLS"); } catch (NoSuchAlgorithmException e) { throw new TransportFactoryInitException("JVM does not have proper libraries for TSL"); ctx.init(null, new TrustManager[] {tm}, new java.security.SecureRandom()); } catch (KeyManagementException e) { throw new TransportFactoryInitException("Unable to init SSLContext with TrustManager", e);
ctx = SSLContext.getInstance("TLS"); } catch (NoSuchAlgorithmException e) { throw new TransportFactoryInitException("JVM does not have proper libraries for TSL"); ctx.init(null, new TrustManager[] {tm}, new java.security.SecureRandom()); } catch (KeyManagementException e) { throw new TransportFactoryInitException("Unable to init SSLContext with TrustManager", e);
@Override public Transport newInstance() throws TransportFactoryInitException { try { Socket socket; if (config.getUseSSL()) { if (config.getVerifySSL()) { socket = SSLSocketFactory.getDefault().createSocket(config.getHostname(), config.getPort()); } else { socket = getSSLContext().getSocketFactory().createSocket(config.getHostname(), config.getPort()); } } else { socket = new Socket(config.getHostname(), config.getPort()); } socket.setReuseAddress(true); Sink sink = Okio.sink(socket); sink.timeout().timeout(config.getTimeout(), TimeUnit.MILLISECONDS); return new TcpTransport(sink, config.getRetryCount(), config.getRetryDelay()); } catch (IOException ex) { throw new TransportFactoryInitException("Error while creating tcp transport", ex); } }
@Override public Transport newInstance() throws TransportFactoryInitException { try { Socket socket; if (config.getUseSSL()) { if (config.getVerifySSL()) { socket = SSLSocketFactory.getDefault().createSocket(config.getHostname(), config.getPort()); } else { socket = getSSLContext().getSocketFactory().createSocket(config.getHostname(), config.getPort()); } } else { socket = new Socket(config.getHostname(), config.getPort()); } socket.setReuseAddress(true); Sink sink = Okio.sink(socket); sink.timeout().timeout(config.getTimeout(), TimeUnit.MILLISECONDS); return new TcpTransport(sink, config.getRetryCount(), config.getRetryDelay()); } catch (IOException ex) { throw new TransportFactoryInitException("Error while creating tcp transport", ex); } }