List of usage examples for com.squareup.okhttp ConnectionSpec COMPATIBLE_TLS
ConnectionSpec COMPATIBLE_TLS
To view the source code for com.squareup.okhttp ConnectionSpec COMPATIBLE_TLS.
Click Source Link
From source file:co.paralleluniverse.fibers.okhttp.CallTest.java
License:Open Source License
@Test public void cleartextCallsFailWhenCleartextIsDisabled() throws Exception { // Configure the client with only TLS configurations. No cleartext! client.setConnectionSpecs(Arrays.asList(ConnectionSpec.MODERN_TLS, ConnectionSpec.COMPATIBLE_TLS)); server.enqueue(new MockResponse()); Request request = new Request.Builder().url(server.getUrl("/")).build(); try {/*from w w w . ja v a 2s . com*/ FiberOkHttpUtil.executeInFiber(client, request); fail(); } catch (UnknownServiceException expected) { assertTrue(expected.getMessage().contains("CLEARTEXT communication not supported")); } }