question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Provide a way to disable cipher suites filtering

See original GitHub issue

Expected behavior

There should be a way to have client side SslContext work against any website, regardless of security.

Actual behavior

Supported ciphers are filtered against a hard coded whitelist (SslUtils#DEFAULT_CIPHER_SUITES).

I wonder if the whitelist way is a good thing. Wouldn’t it filter out modern ciphers that would be introduced in JDK updates? Properly maintaining this blacklist would require Netty core devs to frequently update it. Wouldn’t a blacklist work better: ban ciphers that are known as unsecure?

Then, my core issue is that there’s no way to disable this security. On the client side, sometimes security is not the top most priority and users just want things to work, all the more as they do work with all the other user agents around (browsers, curl, Apache HttpComponents). Typical examples are load tests and web crawlers.

Steps to reproduce

For example, it’s not possible to connect to “https://www.gretalr.com” with a JdkSslHandler while it’s possible with any other user agent I know of (reported against AHC as https://github.com/AsyncHttpClient/async-http-client/issues/1510).

Minimal yet complete reproducer code (or URL to code)

EventLoopGroup eventLoopGroup = new NioEventLoopGroup();
final SslContext sslContext = SslContextBuilder.forClient().build();
final CountDownLatch latch = new CountDownLatch(1);

Bootstrap b = new Bootstrap()
        .group(eventLoopGroup)
        .channel(NioSocketChannel.class)
        .handler(new ChannelInitializer<NioSocketChannel>() {
          @Override
          protected void initChannel(NioSocketChannel nioSocketChannel) {
            SSLEngine sslEngine = sslContext.newEngine(nioSocketChannel.alloc(), "www.gretalr.com", 443);
            SslHandler sslHandler = new SslHandler(sslEngine);
            sslHandler.handshakeFuture().addListener(whenHandshaked -> {
              if (whenHandshaked.isSuccess()) {
                System.out.println("All good");
              } else {
                whenHandshaked.cause().printStackTrace();
              }
              latch.countDown();
            });
            nioSocketChannel.pipeline().addLast(sslHandler);
          }
        });
Channel channel = b.connect("www.gretalr.com", 443).sync().channel();
latch.await();
channel.close();
eventLoopGroup.shutdownGracefully();

Note: I can connect fine if I create the SSLEngine from a javax.net.ssl.SSLContext instead.

Netty version

4.1.20.Final

JVM version (e.g. java -version)

1.8.0_152

OS version (e.g. uname -a)

not relevant

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
slandellecommented, Feb 1, 2018

Will do later tonight

0reactions
normanmaurercommented, Feb 7, 2018
Read more comments on GitHub >

github_iconTop Results From Across the Web

Disable Weak Ciphers in SSL/TLS - VMware Docs
Double-click SSL Cipher Suite Order. In the SSL Cipher Suite Order window, click Enabled. The cipher suites are listed above on separate lines ......
Read more >
Disable the Diffie-Hellman cipher suite - Acoustic Help Center
Disable the Diffie-Hellman cipher suite · In the Apache conf directory, locate the ssl.conf or httpd.conf file. · Look for the SSLCipherSuite ...
Read more >
Disabling weak SSL cipher suites to improve security
Disabling weak SSL cipher suites to improve security ... Summary: this page explains how to modify your Apache Tomcat web application server, ...
Read more >
Disabling Weak Cipher Suites Globally Through Java
You can disable weak cipher suites globally through Java. The JAVAHOME directory has a security file in which you can disable weak cipher...
Read more >
Enable TLS 1.2 strong cipher suites - Deep Security Help Center
Disable TLS 1.2 strong cipher suites · Open the configuration.properties file in <Manager_root>, and remove the line starting with ciphers. · Add ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found