title: SSL with Jetty Built into Jar on EC2
body: <p>Good Day,</p>
  
  <p>I have been struggling to find documentation for "Setting up SSL With Jetty" but there is nothing. I basically have a Jetty Server set up in my Java Program as such. My Java program is compiled into a .jar file, and it can be run instantly on my AMAZON EC2 instance. All Jetty libraries are inside the .jar itself.</p>
  
  <p>It works great on EC2. But I need these Jetty URL's to be secure and on SSL.</p>
  
  <pre><code>import org.eclipse.jetty.server.Server;
  import org.eclipse.jetty.server.Connector;
  import org.eclipse.jetty.server.Request;
  import org.eclipse.jetty.server.handler.AbstractHandler;
  import org.eclipse.jetty.server.nio.SelectChannelConnector;
  import org.eclipse.jetty.servlet.ServletContextHandler;
  import org.eclipse.jetty.servlet.ServletHolder;
  
  private static Server server;
  
  public static void main(String[] args) throws Exception {
      System.out.println("Servers!");
  
      server = new Server();
      Connector connector = new SelectChannelConnector();
      connector.setPort(8081);
      server.addConnector(connector);
  
      ServletContextHandler context = new ServletContextHandler(ServletContextHandler.SESSIONS);
      context.setContextPath("/");
      server.setHandler(context);
      context.addServlet(new ServletHolder(new HelloServlet()),"/*");
      context.addServlet(new ServletHolder(new PostServlet()),"/post/*");
  
      Thread monitor = new CommandThread();
      monitor.start();
  
      server.start();
      server.join();
  </code></pre>
  
  <p>}</p>
  
  <p>Can I know what can be done to enable SSL on these links/servlets?</p>