When creating a StyleBook configuration that uses the SSL protocol, you must upload the SSL certificate files and certificate key files as required by the StyleBook parameters. StyleBook allows you to directly upload the SSL files and key files from your local system by using the NetScaler MAS GUI. You can also use NetScaler MAS APIs to upload certificate files and key files that are already managed by NetScaler MAS.
The StyleBook provided as an example here creates a basic load balancing virtual server configuration on the selected NetScaler instance. The configuration uses the SSL protocol. To create a configuration using this StyleBook, you must provide the name and IP address of the virtual server, select the load balancing method parameters, and upload the certificate file and the certificate key file for the virtual server, or use a certificate file and certificate key file that are already present in the NetScaler MAS. These are specified in the "parameters" section, as shown below:
label: "SSL Certificate File"
description: "The file name of the SSL certificate file"
label: "SSL Certificate Key File"
description: "The file name of the server certificate's private key file"
Two components are then created in the components section of the StyleBook, as shown below. The "my-lbvserver-comp" component is of type ns::lbvserver, where:
- "ns" is the prefix that refers to the built-in namespace netscaler.nitro.config and version 10.5 that you had specified in the import-stylebooks section.
- "lbvserver" is a built-in StyleBook in this namespace. It corresponds to the NetScaler NITRO lbvserver resource of the same name.
The second component " lbvserver-certificate-comp" is of type stlb::vserver-certs-binds. The prefix "stlb" refers to the namespace "com.citrix.adc.stylebooks" and version 1.0 that is specified in the import-stylebooks section of the StyleBook. If the "com.citrix.adc.stylebooks" namespace can be thought of as a folder, "vserver-certs-binds" is another StyleBook (or a file) in that folder. StyleBooks that are in the namespace "com.citrix.adc.stylebooks" are shipped as part of NetScaler MAS.
The "vserver-certs-binds" StyleBook used by user-defined StyleBooks allows you to easily configure the certificates by uploading the certificate and key files to the target NetScaler instance, and by configuring the binding of the certificate and key files to the appropriate virtual servers. The properties for this component are - the name of the lb virtual server and the names of the SSL certificates that you provide while creating the configpack.
description: Binds lbvserver with server certificate
cert-name: $parameters.name + "-lb-cert"
key-name: $parameters.name + "-key"
When you use the API to create a configuration from such a StyleBook, use just the file names (not the full file path). These files are expected to be already available in the certificate and key file folders on NetScaler MAS. The uploaded SSL certificate file is stored on NetScaler MAS in the /var/mps/tenants/.../ns_ssl_certs directory, and the SSL certificate key file is stored in /var/mps/tenants/.../ns_ssl_keys directory in NetScaler MAS.
The following procedure creates a basic load balancing virtual server configuration on a selected NetScaler instance using the SSL protocol from the StyleBook specified above. You can use this procedure to upload the SSL certificate files and the certificate keys files in NetScaler MAS.
To create a configuration for uploading files
1. In NetScaler MAS, navigate to Applications > Configuration, and click Create New. The Choose StyleBook page displays all the StyleBooks that are available in your NetScaler MAS. Scroll down and select Load Balancing Virtual Server (SSL).
The StyleBook parameters appear as a user-interface page that allows you to enter the values for all the parameters defined in this StyleBook.
2. Enter the name of the load balancer and the virtual IP address in the basic load balancer settings section.
3. In SSL Certificates Settings section, select the respective files from your local storage folder. Alternatively, you can select the files present on the NetScaler MAS itself.
4. Select the target NetScaler instance on which the configuration needs to be created, and click Create.
The full content of the file lb-vserver-ssl.yaml is shown below:
Using the NetScaler MAS API to create a configpack
You can also use the NetScaler MAS API to create a configpack that uploads Cert and Key files to the selected NetScaler instance. For more information on how to use APIs, see How to Use API to Create Configurations to Upload Cert and Key Files.
After the StyleBook configuration (configpack) is created on NetScaler MAS, click View objects created to display all the NetScaler objects created on the target NetScaler instance