-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Document SSL certificate configuration #2
Comments
Comment by johncmckim This would be really helpful. On the main page on docker hub, there is a line that shows running a container like so I have tried the config below, but it doesn't seem to work. I've probably got some of the jetty-https.xml config wrong. However, is this the general idea? Something like this in the docs that shows how to do it would be really helpful.
|
Comment by gregw @johncmckim
|
Comment by johncmckim Thanks @gregw that was a big help. I couldn't get the keytool command to work correctly. I found that they keystore path should be I ended up opting to add the
|
Comment by md5 @johncmckim If you want to use your own passwords, it looks like you'd want to append settings for The values for these properties could be generated using These values could be specified for your build using Docker's All that being said, I think in a production context you'd want to avoid generating a self-signed certificate in the |
Comment by johncmckim @md5 I tried the jetty-util as you suggested and it hung every time so I gave up. Mounting an existing keystore makes much more sense. I'll give that a go next week. Any examples would be appreciated. |
Comment by md5 @johncmckim Were you trying in a VM? I tried that and it hung as well after printing out the "OBF" and "MD5" passwords. I believe the issue is that it's calling |
Comment by johncmckim @md5 yes. I was using docker on my windows dev machine. It would be using Virtualbox behind the scenes correct? What you describe is exactly what happened to me. I could see the OBF and MD5 passwords but it would not exit. |
Comment by md5 I opened this issue to discuss the underlying problem around a lack of entropy causing problems for |
Comment by ghost Hello eveyone, I too have the problem of adding ssl to jetty image in docker container. I just used the below commands to add my local keystore to jetty image. any help would be highly appreciated. |
Comment by gregw @VivinrajSundararaj and what goes wrong? Does the container start? Do you get errors/logs? |
Comment by gregw @VivinrajSundararaj FYI I was just able to start a HTTPS connector with:
So I can see that your keystore is incorrectly named and you have a bracket problem. Try being explict and put the keystore at Note you don't need to add the |
Comment by ghost @gregw I have certificate *.pem file and I have added the file to docker container by the docker command as below COPY my-domain.pem /etc/ssl/certs/my-domain.pem docker run -d -p 80:8080 -p 443:8443 -v /home/deploy/backend/ssl:/etc/ssl/certs Can you please help to provide the steps to make the ssl working in docker container in my local machine? |
Comment by mimatn I had to work on this setup for work, and since I obtained something that works, maybe someone may find it useful here. You need:
In the Dockerfile, I copy all those files where they belong (
The My Dockerfile is something like this:
Remeber that you get the obfuscated password with
With the above setup, using:
I have, at port 8443, Jetty serving SSL with my certificate. I hope this is helpful. |
Comment by rvesse @mimatn That's really helpful, have actually been working on something similar this last week myself and figured out much the same One other gotcha that people should be aware of is that Jetty defaults to assuming a JKS format key store, if you are using Java 9+ as the JDK in your image then the default format becomes PKCS12 and trying to start Jetty with a Keystore in that format will produce stack traces like the following:
I believe there is a Jetty setting to change the default format but since in our environment we needed to be backwards compatible to JDK 8 for the time being we added |
Comment by joakime @rvesse Jetty will just use https://docs.oracle.com/javase/8/docs/api/java/security/KeyStore.html |
Issue by md5
Thursday Oct 01, 2015 at 21:01 GMT
Originally opened as appropriate/docker-jetty#20
This should mostly just point at the main Jetty documentation on the subject, but it would probably be good to add some information about how to set up the keystore for the Docker image/container.
The text was updated successfully, but these errors were encountered: