How can I encrypt a connect string for AbleCommerce Gold R2?

For general questions and discussions specific to the AbleCommerce GOLD ASP.Net shopping cart software.
Post Reply
KenPalmer
Lieutenant (LT)
Lieutenant (LT)
Posts: 54
Joined: Fri Sep 21, 2012 9:50 am

How can I encrypt a connect string for AbleCommerce Gold R2?

Post by KenPalmer » Fri Oct 05, 2012 2:54 pm

How do I create a new encrypted connection string with AbleCommerce Gold R2? For instance, when the database password changes, how would I create a new <CipherValue> for the database.config file? Thanks.

User avatar
Logan Rhodehamel
Developer
Developer
Posts: 4116
Joined: Wed Dec 10, 2003 5:26 pm

Re: How can I encrypt a connect string for AbleCommerce Gold R2?

Post by Logan Rhodehamel » Fri Oct 05, 2012 4:18 pm

If it is possible, update the connection string via the AbleCommerce admin interface immediately before you change the password on the database. That way when you update the database password AC will spring back to life. If it is not possible, then there are two options:

1) Manually decrypt the connection string section of web.config, update the password in the database.config file, then reencrypt connection strings with aspnet_regiis.exe. (See http://msdn.microsoft.com/en-us/library ... .100).aspx)

2) Wipe out the database.config with a new plain text content, providing the correct connection string for your database:

Code: Select all

<connectionStrings>
  <add name="AbleCommerce" connectionString="Data Source=SERVER;Initial Catalog=DATABASE;User Id=USER;Password=PASSWORD;" providerName="System.Data.SqlClient" />
</connectionStrings>
Then once you log in to AbleCommerce admin, you can go visit the connection strings settings and choose update to re-encrypt.

Note that AbleCommerce can only encrypt connection strings when it is running in Full trust. If you are in partial trust modes, the only way to encrypt/decrypt is to use the aspnet_regiis tool.
Cheers,
Logan
Image.com

If I do not respond to an unsolicited private message, it's not because I'm ignoring you. It's because the answer to your question is valuable to others. Try the new topic button.

KenPalmer
Lieutenant (LT)
Lieutenant (LT)
Posts: 54
Joined: Fri Sep 21, 2012 9:50 am

Re: How can I encrypt a connect string for AbleCommerce Gold R2?

Post by KenPalmer » Mon Oct 08, 2012 8:09 am

Thanks Logan.

Post Reply