/** Prepares the connection specs to attempt. */ private void resetConnectionSpecs() { connectionSpecs = new ArrayList<ConnectionSpec>(); List<ConnectionSpec> specs = address.getConnectionSpecs(); for (int i = 0, size = specs.size(); i < size; i++) { ConnectionSpec spec = specs.get(i); if (request.isHttps() == spec.isTls()) { connectionSpecs.add(spec); } } nextSpecIndex = 0; }
private boolean shouldSendTlsFallbackIndicator(ConnectionSpec connectionSpec) { return connectionSpec != connectionSpecs.get(0) && connectionSpec.isTls(); }
@Test public void cleartextBuilder() throws Exception { ConnectionSpec cleartextSpec = new ConnectionSpec.Builder(false).build(); assertFalse(cleartextSpec.isTls()); }