Enabling HTTPS connectivity for nodes
The default certificate presented by the application server uses localhost.localdomain. This works only for local node installations (server and node on a single host).
Note:
  • When asked for the certificate/keystore password use: changeit.
  • You can use the default certificate - remember that you may need to use the ./node_add_ssl_cert.sh script after future updates to refresh the certificate on the node
  • For the default certificate - jump to the Node configuration and use the localhost.localdomain instead of the vprotectserver.local example
  • When registering the node locally over HTTPS please note that the URL you should use islocalhost.localdomain - NOT localhost
This section presents the steps necessary for generating an SSL certificate, for setup vProtect to use it and how to register a remote node.

vProtect Server (when using own certificate)

This section describes certificate generation and import on the vProtect Server side. It uses a self-signed certificate. If you would like to use CSR and your own CA instead - please check for additional steps described in the next section.
  1. 1.
    SSH to vProtect Server host
  2. 2.
    Generate the key and certificate (remember to provide a valid vProtect Server DNS hostname - in our example it was vprotectserver.local):
    1
    [[email protected] ~]# openssl req -x509 -newkey rsa:4096 -keyout vprotect.key -out vprotect.crt -days 365
    2
    Generating a 4096 bit RSA private key
    3
    ...............................................................................++
    4
    .............................................................................................................................................................................................................................................................................................................................................++
    5
    writing new private key to 'vprotect.key'
    6
    Enter PEM pass phrase:
    7
    Verifying - Enter PEM pass phrase:
    8
    -----
    9
    You are about to be asked to enter information that will be incorporated
    10
    into your certificate request.
    11
    What you are about to enter is what is called a Distinguished Name or a DN.
    12
    There are quite a few fields but you can leave some blank
    13
    For some fields there will be a default value,
    14
    If you enter '.', the field will be left blank.
    15
    -----
    16
    Country Name (2 letter code) [XX]:PL
    17
    State or Province Name (full name) []:
    18
    Locality Name (eg, city) [Default City]:Warsaw
    19
    Organization Name (eg, company) [Default Company Ltd]: your Company
    20
    Organizational Unit Name (eg, section) []:
    21
    Common Name (eg, your name or your server's hostname) []:vprotectserver.local
    22
    Email Address []:
    Copied!
  3. 3.
    Create the PKCS12 bundle from the certificate and the key:
    1
    [[email protected] ~]# openssl pkcs12 -export -in vprotect.crt -inkey vprotect.key -out vprotect.p12 -name vprotect
    2
    Enter pass phrase for vprotect.key:
    3
    Enter Export Password:
    4
    Verifying - Enter Export Password:
    Copied!
  4. 4.
    Create a keystore for the vProtect Server with the PKCS12 bundle:
    1
    [[email protected] ~]# keytool -importkeystore -destkeystore /opt/vprotect/keystore.jks -srckeystore vprotect.p12 -srcstoretype PKCS12 -alias vprotect
    2
    Enter destination keystore password:
    3
    Re-enter new password:
    4
    Enter source keystore password:
    Copied!
  5. 5.
    Change ownership on the keystore to the vprotect user:
    1
    chown vprotect:vprotect /opt/vprotect/keystore.jks
    Copied!
  6. 6.
    Edit /opt/vprotect/payara.properties and change the path to the keystore: javax.net.ssl.keyStore=/opt/vprotect/keystore.jks
  7. 7.
    Restart the vProtect Server:
    1
    systemctl stop vprotect-server
    2
    systemctl start vprotect-server
    Copied!
  8. 8.
    Make sure that your nodes resolve the host name of the vProtect Server. You also can add an entry in the /etc/hosts like this (example IP: 1.2.3.4):
    1
    1.2.3.4 vprotectserver.local
    Copied!
  9. 9.
    Check with your browser that https://VPROTECT_HOST:8181 presents the certificate that you have just generated.
    • you also can execute the openssl client from the node to print it (check the host name that you have provided in the certificate):
      1
      openssl s_client -connect vprotectserver.local:8181 < /dev/null
      Copied!

Notes on using your own certificate with CSR and your own CA

When using CSR to get a trusted certificate, you need to replace step 2 (self-signed certificate generation) with several steps including CSR generation, and download the CRT signed by your CA. The steps are as follows
  1. 1.
    Generate the CSR - answer the same set of questions as above:openssl req -new -newkey rsa:2048 -nodes -keyout vprotect.key -out vprotect.csr
  2. 2.
    Send your CSR and have it signed by your CA
  3. 3.
    Download your CRT file and save it as vprotect.crt (note that you should have your working directory set to /opt/vprotect)
  4. 4.
    Download your CA certificate chain (example for a single ca.crt) and import it with the CA_ALIAS of your choice as follows: keytool -import -trustcacerts -keystore /usr/lib/jvm/jre/lib/security/cacerts -storepass changeit -noprompt -alias CA_ALIAS -file ca.crt
  5. 5.
    Now continue from PKCS12 bundle generation (step 3 in the section above).

vProtect Node (any SSL certificate)

  1. 1.
    SSH to vProtect Node host
  2. 2.
    Import the server certificate using the script under the /opt/vprotect/scripts folder:
    1
    cd /opt/vprotect/scripts
    2
    ./node_add_ssl_cert.sh [SERVER_HOST] [PORT] [KEYSTORE_PASS]
    Copied!
    where the defaults (if arguments have not been provided) are SERVER_HOST = 127.0.0.1, PORT = 8181, KEYSTORE_PASS = changeit (default java keystore password), examples:
    • Default local installation (Server and Node on the same host):
      1
      ./node_add_ssl_cert.sh
      Copied!
    • Remote Server on the custom port:
      1
      ./node_add_ssl_cert.sh vprotectserver.local 8181
      Copied!
  3. 3.
    Register the node with the NODE_NAME of your choice, the ADMIN_USER user name which you would like to use and the URL to vProtect API, and provide the password when prompted:
    • Syntax:
      1
      vprotect node -r NODE_NAME ADMIN_USER http(s)://VPROTECT_SERVER:PORT/api
      Copied!
    • Remote server with generated certificate:
      1
      vprotect node -r node1 admin https://vprotectserver.local:8181/api
      Copied!
    • Local installation with default certificate:
      1
      vprotect node -r node1 admin https://localhost.localdomain:8181/api
      Copied!
Last modified 3mo ago