Thursday, February 28, 2013

Unable to connect to ASP.NET web service using web application

In this case web developer has created web application installed on IIS 7.5, and this web application was trying to access to asp.net web service which was requesting for client certificate for authentication. Client certificate was issued by publicly trusted certificate authorities. This certificate was installed in machine personal certificate store. Web application's pool identity was delegated access to the private key of the client certificate. During import of the client certificate all intermediate certification authorities were imported into machine personal store.
When the web application was trying to access the web service the following error was returned :
The remote server returned an error: (403) Forbidden.
For testing purposes same client certificate was imported into user's personal certificate store, and same web service was successfully accessed using web browser.

Tracing was enabled, and following lines were into log file:
.... 
System.Net Information: 0 : [4184] SecureChannel#45901694 - We have user-provided certificates. The server has specified 8 issuer(s). Looking for certificates that match any of the issuers.
System.Net Information: 0 : [4184] SecureChannel#45901694 - Left with 0 client certificates to choose from.
..... 

Finally, the resolution for this kind of behavior was to place intermediate certificate authorities certificates from machine personal store into Intermediate Certification Authorities store. After removing Intermediate Certification Authorities Certificates from machine personal store and installing them into Intermediate Certification Authorities Store, the web application was able to connect to the web service.

Friday, February 22, 2013

Adobe Reader XI breaks indexing of pdf files on Windows 8 x64

After installing Adobe Reader XI on Windows 8 x64, I was unable to search the content of the pdf files. After checking the Indexing options for file types for pdf files was showing: Registered IFilter is not found.



The resolution for this behavior is to return the registry setting for native IFilter. Open the registry editor and go to HKEY_CLASSES_ROOT\.pdf\PersistentHandler, and change the value to 1AA9BF05-9A97-48c1-BA28-D9DCE795E93C . Adobe reader overwrote the setting with F6594A6D-D57F-4EFD-B2C3-DCD9779E382E .
After changing the registry key value, restart the Windows Search service, and you will be able to search the content of pdf files.

Tuesday, February 12, 2013

The event log is corrupt

In my case I was unable to see events in Application event log on Windows Server 2003. The following error message was popping out :


Simple resolution for this error is to clear affected event log, and new events will start to log in.
 

Thursday, February 7, 2013

How to convert string to Base64 and vice versa using Powershell

For debugging purposes I needed a quick way to convert Base64 encoded string. My opinion is that  the easiest way to achieve is to use Powershell.

Here is the example how to convert string "Hello World" to Base64 using ToBase64String method:

PS C:\Temp>$b  = [System.Text.Encoding]::UTF8.GetBytes("Hello World")
PS C:\Temp>[System.Convert]::ToBase64String($b)
SGVsbG8gV29ybGQ=

And here is the example how to decode Base64 string using FromBase64String method:

PS C:\Temp>$b  = [System.Convert]::FromBase64String("SGVsbG8gV29ybGQ=")
PS C:\Temp>[System.Text.Encoding]::UTF8.GetString($b)
Hello World


More about using ToBase64String and FromBase64String methods check:
http://msdn.microsoft.com/en-us/library/system.convert.frombase64string.aspx
http://msdn.microsoft.com/en-us/library/system.convert.tobase64string.aspx