Friday, November 7, 2014

HTTP Error 500.24 - Internal Server Error ASP.net 4

HTTP Error 500.24 - Internal Server Error

An ASP.NET setting has been detected that does not apply in Integrated managed pipeline mode.

Most likely causes:

  • system.web/identity@impersonate is set to true.

Things you can try:

  • If the application supports it, disable client impersonation.
  • If you are certain that it is OK to ignore this error, it can be disabled by setting system.webServer/validation@validateIntegratedModeConfiguration to false.
  • Move this application to an application pool using Classic .NET mode - for example, %SystemRoot%\system32\inetsrv\appcmd set app "Default Web Site/" /applicationPool:"Classic .NET AppPool"
(You can set "Classic .NET AppPool" to the name of another application pool running in Classic managed pipeline mode)

Detailed Error Information:

Module   ConfigurationValidationModule
Notification   BeginRequest
Handler   StaticFile
Error Code   0x80070032
Requested URL   https://localhost:443/images/welcome/login2.jpg
Physical Path   C:\images\welcome\login2.jpg
Logon Method   Not yet determined
Logon User   Not yet determined

More Information:

If you are not sure or unable to use the first two options, then it is preferred that you move this application to Classic mode. View more information »


It started working once I changed from
<identity impersonate="true" /> to <identity impersonate="false" /> in file : C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config\web.config

Windows Server 2012 R2, Internet explorer 11 (IE) not able to browse https (SSL secured) sites

Not sure why this is, but the only way it started working was by unchecking option “warn if changing between secure and nonsecure mode” in  Internet explorer 11 (IE) advanced settings. Once done, was able to browse any https sites.

It was really odd this has to be done so https sites can be browsed. Before the change, if you try to navigate via https, the browser will act as if it was not clicked or accessed. I had Internet Explorer Enhanced Security Configuration enabled, so not sure if this has anything to do with the problem

Monday, September 15, 2014

SQL Server Reporting Services (SSRS) and HTTP 400 Bad Request (Invalid Hostname)

If iis (Internet Information Services) is stopped and SSRS (SQL Server Reporting Services) is kept running, you will receive HTTP 400 error with message Bad Request (Invalid Hostname) for any sites that was accessible under the same iis host.

This is bad if you are running under a LB (load balancer) and users accessing the site will start getting the 400 errors.

Only solution is to be sure you stop or start iis and ssrs at the same time. You cannot have one stopped while the other is kept running.

Thursday, September 4, 2014

How to delete empty folders using windows command prompt

A simple way is to do this is to use xcopy to make a copy of the entire directory structure using /s switch. help for /s says Copies directories and subdirectories except empty ones.

xcopy dirA dirB /S

where dirA is source with Empty folders. DirB will be the copy without empty folders

.Net C# - How to Bypass invalid SSL certificate errors when calling web services from .Net

C# (ASP.Net) error
Error:
The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel.
and:
The remote certificate is invalid according to the validation procedure.

Below code can be used to bypass ssl related errors while calling webservices from your .net code


string sUrl = "http://mysite.com/myservice";
System.Net.WebClient client = new System.Net.WebClient();
System.Net.ServicePointManager.ServerCertificateValidationCallback = delegate { return true; };
string sHttpResonse = client.DownloadString(sUrl);

HP Fortify Software Security Center (SSC) install - Deploying Software Security Center in Tomcat

On Deploying Software Security Center in Your Application Server ==> Deploying Software Security Center in Tomcat

From documentation:
Extract the ssc.war file contents into a deployment folder in the Tomcat installation directory


You need to extract the contents. For this, you can use winzip or 7-zip or even rename the .war as zip and open in windows explorer. Extract the contents in folder tomcat_directory_root\webapps (create a new folder ssc over here ie; under webapps)

Wednesday, September 3, 2014

HP Fortify Software Security Center (SSC) install - Error while trying to seed process templates


Seeding a New Fortify Software Security Center (SSC) Database

In SSC configuration tool, option database setup, Seed process Templates was giving an unexpected error.

The HP-Fortify-Server-WAR\logs\ssc-configuration.log file had the below

INFO 2014-09-03 22:55:20,586 [com.fortify.server.configuration.db.DBUtil] - Error occurred during initialization of VM
Could not reserve enough space for object heap

ERROR 2014-09-03 22:55:20,596 [com.fortify.server.configuration.db.DBUtil] - Error seeding db

ERROR 2014-09-03 22:55:20,596 [com.fortify.server.configuration.db.DBUtil] - Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.


After a lot of googling, found that the java VM is not able to allocate enough memory while starting from the host OS. Turns out all I had to do to fix is to edit the "ssc-configuration.cmd" file in "HP-Fortify-Server-WAR" folder and change MAX_MEMORY & MAX_PERMGEN to 512M from the default of 1024M. The seeding process went fine after this update :)

Turn on Windows 11 Fast Boot

If windows starting is slow, to enable windows 11 fast startup/boot,  Press Windows + R, type powercfg.cpl, and hit Enter.  This will direct...