WebSocketsSecure (WSS) Configuration
Prerequisites
certbotandopenssl- RocketSockets v1.1 or above
Instructions
- Run
sudo certbot certonlyon your server that is hooked up to a domain name to generate a HTTPS certificate. Use thestandaloneoption. cdinto the directory specified bycertbotin 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.pfxto the folder where./RocketSocketslives. - Configure RocketSocket’s
appsettings.jsonfile 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.