WebSocketsSecure (WSS) Configuration
Prerequisites
certbot
andopenssl
- RocketSockets v1.1 or above
Instructions
- Run
sudo certbot certonly
on your server that is hooked up to a domain name to generate a HTTPS certificate. Use thestandalone
option. cd
into the directory specified bycertbot
in its final stages (etc/letsencrypt/
someOtherPath) and run the following command:openssl pkcs12 -export -out certificate.pfx -inkey privkey.pem -in cert.pem
. Configure the certificate with a password and remember it.- Copy the generated
certificate.pfx
to the folder where./RocketSockets
lives. - Configure RocketSocket’s
appsettings.json
file with the following settings:
{
"RocketSocketsConfig": {
// snip
"useSecureWebSockets": true,
"webSocketsCertificatePath": "certificate.pfx",
"webSocketsCertificatePassword": "passwordYouSelected"
}
}
You should be able to run WebSocketsSecure servers now! A secure server will start automatically, but you can start secure servers with the --secure
switch and nonsecure servers with the --nosecure
switch.