cancel
Showing results for 
Search instead for 
Did you mean: 

Security issues using ADO.Net provider in web application

d_curioni9
Explorer
0 Kudos

Hi,

I am using the Sap.Data.Hana.v4.5.dll 64 bit DLL (version 2.4.171.0, which I think is the latest), in a 64 bit classic asp.net 4.8 application in c#, against Hana 2.

The application works ok if the application pool runs under the LocalSystem identity in IIS. This is an unsafe setup. If I set the identity as ApplicationPoolIdentity, which is the recommended security setup, as soon as I try to open the HanaConnection I get a System.Security.SecurityException: Requested registry access is not allowed exception.

This is the stack trace:

   System.ThrowHelper.ThrowSecurityException(ExceptionResource resource) +60
Microsoft.Win32.RegistryKey.OpenSubKey(String name, Boolean writable) +14174075 System.Environment.GetEnvironmentVariable(String variable, EnvironmentVariableTarget target) +277 Sap.Data.Hana.HanaUnmanagedDll.SearchNativeDlls() +300 Sap.Data.Hana.HanaUnmanagedDll..ctor() +18 Sap.Data.Hana.HanaUnmanagedDll.get_Instance() +133
Sap.Data.Hana.HanaConnection..cctor() +56

Is there a workaround for this (besides running the IIS worker process as LocalSystem)?

Thanks.

Accepted Solutions (0)

Answers (0)