In many cases you might want to encrypt traffic between your client and the server. To do that you can specify that the server should use HTTPS protocol rather than HTTP.
To enable HTTPS at least the following two directives should be set
in searchd section of the
config and there should be at least one listener set to
https
In addition to that you can specify certificate authority’s certificate (aka root certificate) in
Example with CA:
ssl_ca = ca-cert.pem
ssl_cert = server-cert.pem
ssl_key = server-key.pemExample without CA:
ssl_cert = server-cert.pem
ssl_key = server-key.pemThese steps will help you generate the SSL certificates with ‘openssl’ tool.
Server can use Certificate Authority to verify the signature of certificates, but can also work with just private key and certificate (w/o the CA certificate).
openssl genrsa 2048 > ca-key.pemGenerate self-signed CA (root) certificate from the private key (fill in at least “Common Name”):
openssl req -new -x509 -nodes -days 365 -key ca-key.pem -out ca-cert.pemServer uses the server certificate to secure communication with client. Generate certificate request and server private key (fill in at least “Common Name” different from the root certificate’s common name):
openssl req -newkey rsa:2048 -days 365 -nodes -keyout server-key.pem -out server-req.pem
openssl rsa -in server-key.pem -out server-key.pem
openssl x509 -req -in server-req.pem -days 365 -CA ca-cert.pem -CAkey ca-key.pem -set_serial 01 -out server-cert.pemWhen done you can verify the key and certificate files were generated correctly:
openssl verify -CAfile ca-cert.pem server-cert.pemWhen your SSL config is valid the following things are available:
https port with http and
run queries. Connection will be secured. (attempt to connect to this
port via plain http will be rejected with 400 error code).mysql client tries to use ssl by default, so usual connect
to Manticore in case it has a valid SSL config most probably will be
secured. You can check it by running SQL ‘status’ command after you
connect.When your SSL config is not valid by any reason, which daemon detects by the fact that a secured connection can’t be established (apart non-valid config there may be other reasons, like just inability to load appropriate SSL lib at all), the following things will not work or work non-secured way:
https port. The HTTPS
connections will be dropped.mysql port via mysql client will not
propagate possibility of SSL securing. So, if the client demands it, it
will fail. If not - it will use plain mysql or compressed
connection.###Caution: