[Mono-list] Apache+mod_mono: Auto generated encryption keys not saved error

Gonzalo Paniagua Javier gonzalo.mono at gmail.com
Wed Jan 25 02:04:17 UTC 2012

On Tue, Jan 24, 2012 at 3:20 PM, James Wright
<james.wright at jigsawdezign.com> wrote:
> Hello,
>  I'm running Mono 2.10.2 with Apache 2 + mod_mono on an Amazon Linux server
> and keep getting the following error in the apache error log:
> (info) Auto generated encryption keys not saved:
> System.Security.SecurityException: No access to the given key
>  at Microsoft.Win32.KeyHandler..ctor (Microsoft.Win32.RegistryKey rkey,
> System.String basedir, Boolean is_volatile) [0x00000] in <filename
> unknown>:0
>  It looks like some sort of permission problem accessing the registry store,
> but I have no idea where that is on the filesystem or whether it can (or
> should) be changed?

ASP.NET is creating autogenerated keys for the machine and failing to
safe them. The only problem, other that seen that message, is that
every time the application is started you will get new keys because
they are not being saved.

I think the directory where this is trying to write is somewhere
$SYSCONFDIR/mono/registry (usually /etc/mono/registry). If you allow
the user running apache read, write, and execute permissions on that
folder, Mono will be able to save the autogenerated keys and will
reuse them subsequently. Once the keys are written, the apache user
will only need read and execute permission.


More information about the Mono-list mailing list