Repository navigation
SSL TLS Setup
Bernardusz edited this page Jun 9, 2026
·
1 revision
Levtus supports secure connections over HTTPS using Java KeyStores (JKS or PKCS12).
To enable SSL, call the .ssl() method on your application instance before calling .listen().
Levtus app = Levtus.create();
app.ssl("path/to/keystore.p12", "your-password");
app.listen(8443);Levtus requires a valid certificate stored in a keystore file. You can generate a self-signed certificate for development using the JDK's keytool:
keytool -genkeypair \
-alias levtus \
-keyalg RSA \
-keysize 2048 \
-storetype PKCS12 \
-keystore keystore.p12 \
-validity 3650Levtus will automatically switch to an SSL-capable ServerSocket if .ssl() has been configured. The console output will confirm the mode:
π Levtus Engine started on port 8443 (HTTPS)
- Virtual Threads: Levtus still uses Loom's virtual threads for HTTPS connections, ensuring high performance even with the overhead of encryption.
- Protocol: Currently supports standard TLS protocols provided by the underlying JVM.