Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Dropwizard and SSL

I cannot seem to configure Dropwizard to use ssl.

I've created a key

openssl genrsa -des3 -out server.key 1024

and a certificate

openssl req -new -key server.key -days 365 -out server.crt -x509

and imported it into a keystore

keytool -import -file server.crt -keystore keystore.jks

From there, I've placed the keystore.jks file into /src/main/resources, alongside the config.yaml file for dropwizard.

Then I tried configuring ssl for dropwizard according to the manual:

http:
  ssl:
    keyStore: ./keystore.jks
    keyStorePassword: ********

However, when I navigate to the login page, it only works without https: and gives Error 107 (net::ERR_SSL_PROTOCOL_ERROR): SSL protocol error when using https.

Are there other steps that I'm missing?

like image 902
whiterook6 Avatar asked Feb 20 '13 19:02

whiterook6


People also ask

What is Dropwizard used for?

What is Dropwizard? Dropwizard is an open source Java framework for developing ops-friendly, high-performance RESTful backends. It was developed by Yammer to power their JVM based backend. Dropwizard provides best-of-breed Java libraries into one embedded application package.

Which server does Dropwizard use?

Default Dropwizard Libraries Dropwizard embeds the Jetty servlet container for running web applications. Instead of deploying your applications to an application server or web server, Dropwizard defines a main method that invokes the Jetty server as a standalone process.

Which is better spring boot vs Dropwizard?

The bare bone spring boot app starts in 1.64 seconds whereas the bare bone Dropwizard app took 1.526 seconds to startup. Spring Boot consumes much more memory. This was true. Spring Boot loaded 7591 classes whereas Dropwizard loaded 6255 classes.

What is a Dropwizard server?

Dropwizard is a Java framework for developing ops-friendly, high-performance, RESTful web services.  Dropwizard pulls together stable, mature libraries from the Java ecosystem into a simple, light-weight package that lets you focus on getting things done.


1 Answers

I posted on the mailing list and Codahale was quick to respond. I hadn't set nonblocking+ssl connectors in my configuration yaml file under the http: section. Putting in

connectorType: nonblocking+ssl

fixed everything. Thanks dropwizard wizard!

like image 144
whiterook6 Avatar answered Oct 11 '22 10:10

whiterook6