0

When Jetty deploys a web application, it looks for a file called WEB-INF/jetty-web.xml or WEB-INF/web-jetty.xml within the web application (or WAR) and applies the configuration found there.
This file configures an instance of org.eclipse.jetty.webapp.WebAppContext. Something like this:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure.dtd">

<Configure class="org.eclipse.jetty.webapp.WebAppContext">
 ..
</Configure>

Now, I want to add other configurations to this embedded server, such as SSL support. This requires an instance of org.eclipse.jetty.server.Server to be configured. I have a file jetty-https.xml which configures an instance of org.eclipse.jetty.server.Serverand adds the necessary configurations required.
My question is: how do I make jetty use this jetty-https file.

All my configurations are in XML based. I am running my application through jetty-runner. Version of jetty is: 9.2.**
P.S. I've already searched a lot over the internet. Just don't understand this part.

YetAnotherBot
  • 1,937
  • 2
  • 25
  • 32
  • First, [Jetty 9.2 is EOL (End of Life)](https://dev.eclipse.org/mhonarc/lists/jetty-dev/msg02726.html), consider upgrading. Next, you are asking about standalone Jetty when you refer to `jetty-https.xml`, but then you refer to embedded-jetty in the same question. This is confusing, which mode do you want? – Joakim Erdfelt Jun 05 '18 at 15:37
  • I am looking for SSL in embedded jetty. – YetAnotherBot Jun 05 '18 at 16:22
  • @JoakimErdfelt The question referred to as the duplicate solves it using java. I need a solution to add SSL using **XML** configurations. Is it not possible or I am not asking the right question? – YetAnotherBot Jun 05 '18 at 16:46
  • Based on your response to my prior question. XML == standalone mode, Java == embedded-jetty mode. You said "I am looking for SSL in embedded jetty". Hence the Java version and flag as duplicate. – Joakim Erdfelt Jun 05 '18 at 17:13
  • There is also an additional mode you referenced in your question with `jetty-runner`, but that's just a variant of standalone (not embedded jetty). – Joakim Erdfelt Jun 05 '18 at 17:14
  • Thanks. So, I have 2 questions. First: I am running my application through jetty-runner. Doesn't it count as embedded jetty? Second: Since I do not start my server through java code, how should I go about to add SSL with jetty-runner implementation ? – YetAnotherBot Jun 05 '18 at 17:19
  • Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/172527/discussion-between-aditya-gupta-and-joakim-erdfelt). – YetAnotherBot Jun 05 '18 at 17:24
  • Please ask a new, and clear, question about jetty-runner and XML use, specifically about SSL. But know that jetty-runner is deprecated and slated for removal once Java 8 is no longer updated. (it doesn't, and cannot work with JEP 238 changes introduced Java 9, Java 10, and Java 11) – Joakim Erdfelt Jun 05 '18 at 17:27
  • Ohk. Thankyou ! – YetAnotherBot Jun 05 '18 at 17:51

0 Answers0