Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7755273
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T12:31:37+00:00 2026-06-01T12:31:37+00:00

I am using Netty as backend in a Java-based Usenet client. The library is

  • 0

I am using Netty as backend in a Java-based Usenet client. The library is working fine, however, in some circumstances I can’t connect to a remote server via SSL, because of exactly this error:

Java: Why does SSL handshake give 'Could not generate DH keypair' exception?

Unfortunately, it seems that for whatever reason this Java error still has not been fixed yet. And since the remote server is not under my control, I need a workaround here. One such “solution”, according to the link above, is to avoid DH during SSL handshake at all (not very pretty, but maybe better than nothing).

However, I am no SSL expert, so I am not really sure how I can implement that within Netty; or better: within my solution that is based on Netty. By now I am creating connections as this:

// configure the Netty client
ClientBootstrap bootstrap = new ClientBootstrap(clSockChannelFactory);

// configure the pipeline factory
bootstrap.setPipelineFactory(channelPipelineFactory);
bootstrap.setOption("tcpNoDelay", true);
bootstrap.setOption("keepAlive", true);
bootstrap.setOption("child.receiveBufferSizePredictorFactory", 
          new AdaptiveReceiveBufferSizePredictorFactory());

// start the connection attempt
InetSocketAddress isa = new InetSocketAddress(serverAddress, port);
ChannelFuture future = bootstrap.connect(isa);
...
channel = future.getChannel();
...

Ok, that’s fine, but where can I disable cipher suites before I connect the SSL socket, as desribed in the thread above?

Thanks in advance for all your help!

Kind regards, Matthias

PS: By the way, any ideas why this problem has not been addressed in Java yet?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T12:31:38+00:00Added an answer on June 1, 2026 at 12:31 pm

    I’m not familiar with Netty, but I would suggest following the approach in the secure chat example.

    I’m not sure what default SSL/TLS keys/trust settings you have, but if you don’t have a custom SSLContext, try SSLContext.getDefault().

    Then, create an SSLEngine using SSLContext.createSSLEngine(). On this SSLEngine, you should be able to enable the cipher suites you want. Assuming you’re using the Oracle JRE (or OpenJDK), you’ll find the list of cipher suites in the Sun Provider documentation.

    After this (this is the Netty-specific part), set an SslHandler using something like this (see Netty example):

    pipeline.addLast("ssl", new SslHandler(engine));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My TCP server is implemented using Netty. My client using vanilla java.net.Socket to connect
How can I do long-polling using netty framework? Say for example I fetch http://localhost/waitforx
I am designing a binary protocol for client/server communication using Netty and the number
I'm trying to implement long polling using Netty and jQuery. I have it working
I'm using the Netty library (version 4 from GitHub). It works great in Scala,
I am currently using a non-blocking SocketChannel (Java 1.6) to act as a client
I'm using Netty Http client to send requests to a http server. I am
I have made an client - server example using netty. I have defined handlers
I'm currently using Play! 1.2.2 and its new Netty client framework. I haven't found
My Netty communications classes work fine in a standard Java application but when I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.