Using a secure Klocwork Server connectionUsing a secure Klocwork Server connectionYou can set up Klocwork tools to use a secure HTTP connection (https). This means all Klocwork client tools that connect to the Klocwork Server will connect using SSL. Perform the following steps to set up SSL:
You can use kwauthconfig to generate an unsigned certificate, or you can generate your own signed certificate. Both scenarios are explained below. Configure the Klocwork Server to use SSL - Unsigned certificateThis section shows you how to generate an unsigned SSL certificate by using kwauthconfig. See the next section if you want to generate your own signed certificate. You can configure SSL as part of setting up access control. You can also configure SSL later. If you haven't already set up access control:
If you've already set up access control:
Text fields for setting up SSL with kwauthconfig
Configure the Klocwork Server to use SSL - Signed certificateWhen you set up the Klocwork Server to use a secure connection by using kwauthconfig as shown above, the generated certificate is unsigned. If you want to use your own signed certificate, create a self-signed keystore file, then run the kwauthconfig utility to detect the settings. Important: The following procedure provides basic instructions for creating a self-signed keystore using the Java Development Kit tool "keytool", which you can find at <Server_install>/_jvm/bin. However, Klocwork strongly recommends that you read the following for more information:
For example, you may want to use the -validity flag to change the default certificate validity period. Create a self-signed keystore fileFrom <Server_install>, run the following command: _jvm/bin/keytool -genkeypair -alias tomcat -keyalg RSA -keystore <projects_root>/tomcat/conf/.keystore -dname "cn=<KlocworkServer_hostname>, ou=<your_organizational_unit>,o=<your_organization>" -keypass changeit -storepass changeit where
The keystore is saved into the Tomcat config directory at <projects_root>/tomcat/conf. Example command line: _jvm/bin/keytool -genkeypair -alias tomcat -keyalg RSA -keystore <projects_root>/tomcat/conf/.keystore -dname "cn=testserver.klocwork.com, ou=Development, o=Klocwork" -keypass changeit -storepass changeit This command generates a keystore file named .keystore. Configure the Klocwork Server to use SSL (using kwauthconfig)
After completing these steps, continue to the section Configure Klocwork client tools to use SSL. Configure the Klocwork Server to use SSL (manually)If you need to manually configure/enable SSL on the Klocwork Server (for example, if you are running Klocwork on servers and only have shell access), the steps are as follows: Prerequisite: Your .keystore file must have been previously created and saved at <projects_root>/tomcat/conf
After completing these steps, continue to the section Configure Klocwork client tools to use SSL. Configure Klocwork client tools to use SSLNote: This section provides information on setting up a secure Klocwork Server connection after installation. You can set up SSL during installation as well, with:
Client certificates supportYou can configure the Klocwork tools to work with client certificates to support Public-key infrastructure (PKI) and smart cards. Client certificates are also supported for use with the Klocwork Web API. Prerequisites:
To enable this:
Your trusted client certificates keystore should be created by your administrator and contain the certificates for all users with access to the Klocwork tools. When accessing the Klocwork portal login page in your browser, Chrome and Internet Explorer will ask you to select your client certificate the first time the page is accessed. After the initial time, your browser will remember your choice automatically. Firefox uses a separate keystore, so it requires some manual configuration:
When you open Firefox for the first time after completing these steps, it may ask you to verify the certificate. After this, you will be able to access the Klocwork portal login page without any prompts. Command-line tools that connect to Klocwork ServerSpecify the --url option, which also allows you to specify the host and port of the Klocwork Server plus the name of the integration project for some commands. Specify https in the URL instead of http. kwadmin --url https://myserver:8080/ Tip: If you still use the older --host and --port options, you can use the --ssl option instead of the --url option. kwadmin --ssl --host myserver --port 8080 GUI-based client toolsFor the IDE plug-ins and Klocwork Desktop enable the "Use secure connection" option when connecting to the Klocwork Server. Browser-based client toolsFor Klocwork Static Code Analysis, Klocwork Code Review and Klocwork Documentation, specify https instead of http in the URL. Note that users may be prompted to download a file if they use http. Example for Klocwork Static Code Analysis: https://myserver.mydomain.com:8080/ Certificate warning issued by browser-based client toolsWhen connecting to the Klocwork browser-based tools after SSL has been configured on the Klocwork Server, users will see a warning, such as:
Users can add an exception for the Klocwork Server, so that they do not see this message in future. Consult your browser help for more information. Disabling the SSL connection
Simple bind failed error when trying to connect to Active DirectoryIf you use a secure connection to the LDAP server and you see an error like the following when trying to connect to Active Directory:
simple bind failed: ad.hostname.com:636
Failed to connect to server due to missing PKI certificateIf you work with client certificates to support Public-key infrastructure (PKI) and smart cards, and you see an error like the following:
Ensure that the smart card is inserted properly into the reader and the appropriate certificate is installed in the Windows certificate store. |