Skip to content

SSL TLS Setup

Bernardusz edited this page Jun 9, 2026 · 1 revision

πŸ” SSL/TLS Setup

Levtus supports secure connections over HTTPS using Java KeyStores (JKS or PKCS12).

πŸš€ Enabling HTTPS

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);

πŸ›  Preparing your KeyStore

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 3650

πŸ“‘ Automatic Detection

Levtus 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)

⚠️ Important Notes

  • 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.

🐧 Getting Started

🧩 Core API

πŸ“¦ Features

πŸ›‘οΈ Security & Stability

πŸš€ Performance & Deployment

🀝 Project

Clone this wiki locally