1

I have already developed a grizzly-based-HTTP-Server. In order to test my Server I also developed a grizzly-based-Client, which can comunicate with my Server using http-Messages. I instantiate my http-Server using grizzly as following:

HttpServer server = HttpServer.createSimpleServer();
server.addListener(new NetworkListener("server","127.0.01",8081);
server.getServerConfiguration().addHttpHandler(new Handler());

try {
    server.start();
    Thread.currentThread().join();

} catch (IOException e) {
    e.printStackTrace();
}catch (InterruptedException e) {
    e.printStackTrace();
}

Now I want to secure the communication between them. When I am searching for Informations about possible implementation of ssl in grizzly, I found this link SSL with Grizzly and Jersey. I noticed that I should use SSLContextConfigurator combined with Jersey. This means for me that I must modify my grizzly based Server, which is totally based on grizzly. Before doing this step, I must be sure that I can implement my AES-preshared-key using Jersey Combined with grizzly. Till now I found no example that Shows how to use AES-preshared-key in Java.

According to my readings about preshared-key-method, I knew that I should use javax.crypto.Cipher. Now I am confused about adding this functinality(ssl with preshared key) to my Server. Any idea?

Community
  • 1
  • 1
amitakCs
  • 355
  • 9
  • 25

1 Answers1

0

Have you checked SSLEngineConfigurator docs? You can add TLS v1.2 ciphers from this page to enabledCipherSuites in your ssl configuration. That page also gives you the list including compatibility with different JDK versions.

This should give you an idea how to proceed with SSL using Grizzly.

mostruash
  • 4,169
  • 1
  • 23
  • 40
  • yes I checked SSLEngineConfigurator docs. What I know is that PSK ciphers are not supported. I looked in the list you provide me. Unfortunately, It is not supported. I will use certificates. Thank you for the example combining SSL and Grizzly – amitakCs Sep 08 '15 at 10:15