title: howto create/load a jks file with the java keytool for jetty?
body: <p>while i was setting up jetty with a ssl connector i noticed that i need to set a keystorepath.</p>
  
  <pre><code>sslContextFactory.setKeyStorePath(EmbeddedServer.class.getResource("/keystore.jks").toExternalForm());
  </code></pre>
  
  <p>So i tried to create a keystore.jks file with javas keytool. With commands like this:</p>
  
  <pre><code>keytool -keystore clientkeystore -genkey -alias client
  </code></pre>
  
  <p>But somehow i never endet up with a .jks file.</p>
  
  <p>Can someone help me generate this jks file?</p>
  
  <p>Or are there alternate solutions to setup ssl for jetty without a .jks file?</p>
  
  <p>UPDATE:</p>
  
  <p>I was able to generate a jks file but now the question is how do i load it?</p>
  
  <p>My code so far:</p>
  
  <pre><code>Server server = new Server();
  ServerConnector connector = new ServerConnector(server);
  connector.setPort(9999);
  
  HttpConfiguration https = new HttpConfiguration();
  https.addCustomizer(new SecureRequestCustomizer());
  
  
  SslContextFactory sslContextFactory = new SslContextFactory();
  sslContextFactory.setKeyStorePath("./resources/server.jks"); 
  
  sslContextFactory.setKeyStorePassword("123456");
  sslContextFactory.setKeyManagerPassword("123456");
  </code></pre>