title: Jetty with SSL in Spring Boot 1.2.1
body: <p>How should I configure Jetty with SSL connector in Spring Boot 1.2.x ?</p>
  
  <p>The following configuration is working for Spring boot 1.1.6 but gives <strong>'SslSocketConnector cannot be resolved to a type'</strong> error for the version 1.2.1.</p>
  
  <pre><code>@Configuration
  @EnableAutoConfiguration
  public class OptosoftOAuthSecurityApplication implements
          EmbeddedServletContainerCustomizer {
  
      public static void main(String[] args) {
          SpringApplication.run(OptosoftOAuthSecurityApplication.class, args);
      }
  
      @Override
      public void customize(ConfigurableEmbeddedServletContainer container) {
          if (container instanceof JettyEmbeddedServletContainerFactory) {
              customizeJetty((JettyEmbeddedServletContainerFactory) container);
          }
      }
  
      public void customizeJetty(
              JettyEmbeddedServletContainerFactory containerFactory) {
          containerFactory.addServerCustomizers(jettyServerCustomizer());
      }
  
      @Bean
      public JettyServerCustomizer jettyServerCustomizer() {
          return new JettyServerCustomizer() {
  
              @Override
              public void customize(Server server) {
                  SslContextFactory sslContextFactory = new SslContextFactory();
                  sslContextFactory.setKeyStorePassword("jetty6");
                  try {
                      sslContextFactory.setKeyStorePath(ResourceUtils.getFile(
                              "classpath:jetty-ssl.keystore").getAbsolutePath());
                  } catch (FileNotFoundException ex) {
                      throw new IllegalStateException("Could not load keystore",
                              ex);
                  }
  
                  // THIS CLASS cannot be resolved !!!!!!  
                  SslSocketConnector sslConnector = new SslSocketConnector(
                          sslContextFactory);
                  sslConnector.setPort(9443);
                  sslConnector.setMaxIdleTime(60000);
                  server.addConnector(sslConnector);
              }
          };
      }
  
      @Bean
      @ConditionalOnMissingBean(RequestContextListener.class)
      public RequestContextListener requestContextListener() {
          return new RequestContextListener();
      }
  }
  </code></pre>
  
  <p>My pom.xml (Spring Boot version is 1.2.1 in parent POM):-</p>
  
  <pre><code>&lt;dependencies&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter-web&lt;/artifactId&gt;
              &lt;exclusions&gt;
                  &lt;exclusion&gt;
                      &lt;artifactId&gt;spring-boot-starter-tomcat&lt;/artifactId&gt;
                      &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
                  &lt;/exclusion&gt;
              &lt;/exclusions&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter-jetty&lt;/artifactId&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter-security&lt;/artifactId&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.security.oauth&lt;/groupId&gt;
              &lt;artifactId&gt;spring-security-oauth2&lt;/artifactId&gt;
          &lt;/dependency&gt;
      &lt;/dependencies&gt;
  </code></pre>