Overview
Demonstrates how to set up Resware components using a customized database connection. This guide will alter the default password that Resware uses for database connections.
Version history
Version | Date |
ID |
Description |
9.9 |
11/15/2019 |
Functionality available |
SQL Server
There are two SQL server database connections that can be configured:
- Internal: The default database connection that is used for general read and write operations. This covers all database activity that isn’t audit logging.
- Audit: This database connection is used for audit logging purposes.
In SQL server, there should already be two logins, Audit and Internal. To create a customized password, edit one or both of the logins in SQL server and set the desired password. For the purposes of this guide, set the Audit password to auditPass and the Internal password to internalPass.
Connection String Config
The new passwords must now be encrypted and be added to the configuration file of each Resware component. A utility is available by request from support@resware.qualia.com.
- Select INTERNAL under User Type, enter internalPass into the password field. Then switch User Type to AUDIT and enter auditPass into the password field. Press the Test button to test the database connection to make sure the Resware database accepts this connection. The Make Config button will generate the config file information. This information must be copied into a config file for customizing the database connection.
NOTE: The connection string generated by this utility is computer-specific. This guide does not cover sharing connection strings across computers. If this is desired, see Microsoft’s Walkthrough: Encrypting Configuration Information Using Protected Configuration.
Windows Client
- Edit the Resware.exe.config file.
- Add this line inside the configuration node:
<connectionStrings configSource=”connections.config”/>
- Create a new connections.config file in the same directory as Resware.exe.config. Without this file existing, this Resware application will fail to run.
- Run the Connection String Config utility to generate the connection strings.
- Copy the connection strings into the connections.config file. Example:
- Repeat for each Resware Windows client machine.
Auto-updater
Considerations will need to be made for the Resware auto-updater. There are two config files so the auto-updater doesn’t overwrite the connections.config file. By updating only the Resware.exe.config file on the auto-updater, following the instructions above, all new versions of Resware will continue to work without further configuration. If the Resware.exe.config file is not updated to contain the reference to connections.config, the next time a Resware client updates, it will no longer have a reference to the config file with the database connection string.
Application Server
- Run the Connection String Config utility on the application server to generate the connection strings.
- Copy the connection strings into the server’s config file, either Server.exe.config or ServerService.exe.config. The following is an example of what the config file will look like:
NOTE: If desired, the connection strings can be added into a separate config file, similar to the Windows client method.
Website
- Run the Connection String Config utility on the website machine to generate the connection strings.
- Copy the connection strings into the website’s config file, Web.config. The following example is what the config file will look like:
NOTE: If desired, the connection strings can be added into a separate config file, similar to the Windows client method.
API
- Run the Connection String Config utility on the API machine to generate the connection strings. If this is on the same server as the website, the same connection string can be used.
- Copy the connection strings into the API’s config file, Web.config.
ResMail
- Run the Connection String Config utility on the ResMail machine to generate the connection strings.
- Copy the connection strings into the email proxy’s config file, ReswareExchangePluginProxy.exe.config.
Troubleshooting
The RSA key container was not found.
If this message is received, then IIS probably wasn’t fully set up. To fix, follow these steps:
- Open an administrator command prompt
- Browse to C:\Windows\Microsoft.NET\Framework\v4.0.30319\
- Run this command: aspnet_regiis.exe –pc “<name of keyContainer>”
- Example: aspnet_regiis.exe -pc “NetFrameworkConfigurationKey”
- Then you may need to run the steps below to give access to this key to the necessary users.
Failed to decrypt using provider ‘RsaProtectedConfigurationProvider’. Error message from the provider: The RSA key container could not be opened.
The RSA key container could not be opened.
If this message is received when launching Resware, the user running the application doesn’t have access to the RSA key. To fix, follow these steps:
- Find the name of the RSA key. Browse to C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config and view the machine.config file. Search for RsaProtectedConfigurationProvider and use the name in keyContainerName.
- Open an administrator command prompt
- Browse to C:\Windows\Microsoft.NET\Framework\v4.0.30319\
- Run this command: aspnet_regiis.exe –pa “<name of keyContainer>” “<user to grant access to>”
- Example: aspnet_regiis.exe -pa “NetFrameworkConfigurationKey” “Users”
- This will grant access to the default RSA key to all users on this computer. This may be a suitable command to run for an RDP server that hosts the Resware Windows client. But when giving access on a web or application server, refining the command to the specific user running the service will result in better security.
- Example: aspnet_regiis.exe -pa “NetFrameworkConfigurationKey” “Users”
Application fails to start and either no error message is received or a TypeInitializationException occurs.
Check the config file for the application. If the ConnectionStrings tag is before the ConfigSections tag, this issue may occur. Add the ConnectionStrings tag after the ConfigSections tag.
Failed to decrypt using provider ‘RsaProtectedConfigurationProvider’. Error message from the provider: The parameter is incorrect.
The config file for the connection string utility may have gotten corrupted. Try downloading the config file again and rerunning the app.