Since v5.10.0 automatic configuration is very easy, proxy will generate TLS certificate and private key. Files (cert.pem and cert_key.pem) will be stored in current working directory or data directory (--data-dir). Once files generated TLS is ready to use, no additional configuration required, you can skip the remaining article, unless you need custom configuration. To disable automatic TLS configuration, use global config option "tls": false, or manually configure it.
Best option is obtain trusted certificate from Let's Encrypt . If it is not possible you can use a self-signed certificate, created by yourself or generated by the proxy.
Example bind configuration:
"bind": [
{
"host": "0.0.0.0",
"port": 443,
"tls": true
}
],Command line equivalent is --tls-bind 0.0.0.0:443.
Since v5.10.0 meaning of tls option changed:
false TLS autodetection, was disable TLS, default if not specified.true always use TLS.Example global tls configuration:
"tls": {
"enabled": true,
"cert": "/etc/letsencrypt/live/donate.ssl.xmrig.com/fullchain.pem",
"cert_key": "/etc/letsencrypt/live/donate.ssl.xmrig.com/privkey.pem",
"dhparam": "dhparam.pem",
"protocols": null,
"ciphers": null,
"ciphersuites": null
},Command line equivalent is --tls-cert /etc/letsencrypt/live/donate.ssl.xmrig.com/fullchain.pem --tls-cert-key /etc/letsencrypt/live/donate.ssl.xmrig.com/privkey.pem --tls-dhparam dhparam.pem.
Options cert and cert_key is required, you must property configure it to use TLS, dhparam is optional, but recommended to use for enhanced security. All other options for advanced usage only, usually don't need change it.
| Syntax | "tls": { "cert": file } --tls-cert file |
|---|---|
| Default | null |
| Example | "/etc/letsencrypt/live/<domain>/fullchain.pem" |
| OpenSSL | SSL_CTX_use_certificate_chain_file |
| Syntax | "tls": { "cert_key": file } --tls-cert-key file |
|---|---|
| Default | null |
| Example | "/etc/letsencrypt/live/<domain>/privkey.pem" |
| OpenSSL | SSL_CTX_use_PrivateKey_file |
| Syntax | "tls": { "dhparam": file } --tls-dhparam file |
|---|---|
| Default | null |
| Example | "dhparam.pem" |
| OpenSSL | SSL_CTX_set_tmp_dh |
Optional, but recommended to use for enhanced security. Since v5.10.0 if do not specify this option, proxy will use builtin predefined DH parameters.
To generate your dhparam.pem file, run in the terminal: openssl dhparam -out dhparam.pem 2048
| Syntax | "tls": { "protocols": protocols } --tls-protocols protocols |
|---|---|
| Default | null |
| Example | "TLSv1 TLSv1.1 TLSv1.2 TLSv1.3" |
If protocol list not specified, OpenSSL defaults will be use. SSLv2 and SSLv3 is always disabled as unsecure.
| Syntax | "tls": { "ciphers": ciphers } --tls-ciphers ciphers |
|---|---|
| Default | null |
| Example | "HIGH:!aNULL:!MD5" |
| OpenSSL | SSL_CTX_set_cipher_list |
| Syntax | "tls": { "ciphersuites": ciphersuites } --tls-ciphersuites ciphersuites |
|---|---|
| Default | null |
| Example | "TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256:TLS_AES_128_GCM_SHA256" |
| OpenSSL | SSL_CTX_set_ciphersuites |