how to set https ssl in dw6.x ?

156 views
Skip to first unread message

Baserock Ko

unread,
Oct 29, 2013, 2:12:46 AM10/29/13
to dropwiz...@googlegroups.com
i want to know how to set the ssl port , use http and https together.

Lance N.

unread,
Oct 29, 2013, 4:26:27 PM10/29/13
to dropwiz...@googlegroups.com
You need a Java keystore file with a server-side certificate. There are lots of tutorials on the web about how to make one of these.

After this, you need to add these lines to your DW yaml file:
http:
  port: 8443
  ssl:
    keyStore: /path/to/keystore.file
    keyStorePassword: password of keystore file

This is the minimal set of changes that worked for us.

Coda Hale

unread,
Oct 29, 2013, 4:34:38 PM10/29/13
to dropwiz...@googlegroups.com
This is not possible in Dropwizard 0.6.x.

It can either use HTTP or HTTPS, but not both at the same time.


On Mon, Oct 28, 2013 at 11:12 PM, Baserock Ko <baser...@gmail.com> wrote:
i want to know how to set the ssl port , use http and https together.

--
You received this message because you are subscribed to the Google Groups "dropwizard-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dropwizard-us...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



--
Coda Hale
http://codahale.com

Lance N.

unread,
Oct 29, 2013, 5:29:13 PM10/29/13
to dropwiz...@googlegroups.com
Apologies, I did not catch that. The directions I gave switch my DW 0.6.2 instance from HTTP to HTTP/S.

We had a problem with our SSL testing. A Java 6 client could not connect to our DW. .NET, Java 7 and the 'curl' program all work. This situation is probably a 'bump in the night' with our keystore file, certificate authority (GoDaddy not my choice) and our SSL skills. It is probably not a DW/Jetty problem.

I'm not asking for SSL advice, just pointing out an N-connects-to-Z situation.

Baserock Ko

unread,
Oct 29, 2013, 10:13:00 PM10/29/13
to dropwiz...@googlegroups.com
I just uncomment the ssl section just like you give the lines, but it still use http, i use the default example.keystore and nothing change example.yml .

Kris Glover

unread,
Oct 30, 2013, 2:41:59 PM10/30/13
to dropwiz...@googlegroups.com
This seems like a useful thing to add. I have no problem doing the work and submitting a patch but before I do could you let me know if there's some bigger reason why this would be a bad idea?

Thanks

Graham O'Regan

unread,
Oct 30, 2013, 3:18:49 PM10/30/13
to dropwiz...@googlegroups.com
It is possible in the 0.7.0 branch, just not in 0.6.2 as Coda mentioned, it would be worth looking at upgrading to the newer version rather than patching the existing one.

Kris Glover

unread,
Oct 30, 2013, 3:23:02 PM10/30/13
to dropwiz...@googlegroups.com
Great thanks. I just checked out 0.7.0 and saw that it's available there. I had no idea 0.7 was such a big change. Luckily I'm pretty early in my project so migrating shouldn't be a huge issue. 

Thanks again!  

Baserock Ko

unread,
Oct 30, 2013, 10:10:51 PM10/30/13
to dropwiz...@googlegroups.com
why i can't switch to https like you give the config? 


On Wednesday, October 30, 2013 4:26:27 AM UTC+8, Lance N. wrote:

Lance Norskog

unread,
Oct 31, 2013, 3:28:05 PM10/31/13
to dropwiz...@googlegroups.com
You can use http/s with that configuration. You cannot use both http and http/s in the same service.
--
You received this message because you are subscribed to a topic in the Google Groups "dropwizard-user" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/dropwizard-user/d1Sa2AzZuqg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to dropwizard-us...@googlegroups.com.

Baserock Ko

unread,
Nov 4, 2013, 3:38:09 AM11/4/13
to dropwiz...@googlegroups.com
the yml file not support the https config, i just not figure the problem . it's so Strange!

Baserock Ko

unread,
Nov 10, 2013, 8:41:07 PM11/10/13
to dropwiz...@googlegroups.com
finally, make it.
just add config: connectionType: nonblocking+ssl
Reply all
Reply to author
Forward
0 new messages