This creates the directory where we clone the latest letsencrypt. Then we start the manual process to create certificates.
A terminal application will start asking you for your email for correspondence (although you'll not need to check your email to do anything of this), and the domains for which you want the certificate.
Then it'll break out of that and ask you to create a file on your publically available site for it to check.
Once that check is finished, it'll output the certificates to /etc/letsencrypt/live/yourdomain.com.
Now your existing /etc/apache2/sites-available/your-file-name.conf should look something like
First create a HttpConfiguration with a HTTP configuration that explains its secure scheme and port:
HttpConfiguration http_config = new HttpConfiguration();
Then we'll create another HttpConfiguration for https that extends from the above but adds a SecureRequestCustomizer
HttpConfiguration https_config = new HttpConfiguration(http_config);
Next create a SslContextFactory that points to your Java keystore
SslContextFactory sslContextFactory = new SslContextFactory("/its_dir/cert.keystore");
Note you can prefix the password with OBF: if you're going to use the Jetty obfuscated password.
Next we're creating the ServerConnector, passing in the Server class, a SslConnectorFactory and a HttpConnectionFactory.
ServerConnector httpsConnector = new ServerConnector(server,
new SslConnectionFactory(sslContextFactory, "http/1.1"),
Finally use this connector, maybe along with a normal Http ServerConnector, to the Server.