@Override public final List<String> cipherSuites() { return ctx.cipherSuites(); }
@Override public final List<String> cipherSuites() { return ctx.cipherSuites(); }
@Test public void testUseJdkCiphersWhenNotSpecified() throws Exception { SSLContext context = SSLContext.getInstance("TLS"); context.init(null, null, null); SSLEngine engine = context.createSSLEngine(); String[] expected = engine.getEnabledCipherSuites(); SSLHelper helper = new SSLHelper(new HttpClientOptions(), Cert.CLIENT_JKS.get(), Trust.SERVER_JKS.get()); SslContext ctx = helper.getContext((VertxInternal) vertx); assertEquals(new HashSet<>(Arrays.asList(expected)), new HashSet<>(ctx.cipherSuites())); }
@Override public final List<String> cipherSuites() { return ctx.cipherSuites(); }
@Test public void testUseOpenSSLCiphersWhenNotSpecified() throws Exception { Set<String> expected = OpenSsl.availableOpenSslCipherSuites(); SSLHelper helper = new SSLHelper( new HttpClientOptions().setOpenSslEngineOptions(new OpenSSLEngineOptions()), Cert.CLIENT_PEM.get(), Trust.SERVER_PEM.get()); SslContext ctx = helper.getContext((VertxInternal) vertx); assertEquals(expected, new HashSet<>(ctx.cipherSuites())); }
@Test public void testUseJdkCiphersWhenNotSpecified() throws Exception { SSLContext context = SSLContext.getInstance("TLS"); context.init(null, null, null); SSLEngine engine = context.createSSLEngine(); String[] expected = engine.getEnabledCipherSuites(); SSLHelper helper = new SSLHelper(new HttpClientOptions(), Cert.CLIENT_JKS.get(), Trust.SERVER_JKS.get()); SslContext ctx = helper.getContext((VertxInternal) vertx); assertEquals(new HashSet<>(Arrays.asList(expected)), new HashSet<>(ctx.cipherSuites())); }
@Override public final List<String> cipherSuites() { return ctx.cipherSuites(); }
@Override public final List<String> cipherSuites() { return ctx.cipherSuites(); }
@Override public final List<String> cipherSuites() { return ctx.cipherSuites(); }
@Test public void testUseOpenSSLCiphersWhenNotSpecified() throws Exception { Set<String> expected = OpenSsl.availableOpenSslCipherSuites(); SSLHelper helper = new SSLHelper( new HttpClientOptions().setOpenSslEngineOptions(new OpenSSLEngineOptions()), Cert.CLIENT_PEM.get(), Trust.SERVER_PEM.get()); SslContext ctx = helper.getContext((VertxInternal) vertx); assertEquals(expected, new HashSet<>(ctx.cipherSuites())); }
private static ManagedChannel getGenomicsManagedChannel(List<ClientInterceptor> interceptors) throws SSLException { // Java 8's implementation of GCM ciphers is extremely slow. Therefore we disable // them here. List<String> defaultCiphers = GrpcSslContexts.forClient().ciphers(null).build().cipherSuites(); List<String> performantCiphers = new ArrayList<>(); for (String cipher : defaultCiphers) { if (!cipher.contains("GCM")) { performantCiphers.add(cipher); } } return NettyChannelBuilder.forAddress(GENOMICS_ENDPOINT, 443) .negotiationType(NegotiationType.TLS) .sslContext(GrpcSslContexts.forClient().ciphers(performantCiphers).build()) .intercept(interceptors) .build(); }
break; case SERVER_INITIATED: r = new Renegotiation(rt, sc.cipherSuites().get(sc.cipherSuites().size() - 1)); break; case CLIENT_INITIATED: r = new Renegotiation(rt, cc.cipherSuites().get(cc.cipherSuites().size() - 1)); break; default: