Programming

Blog posts related to programming
Convert CRT to PFX

Every time I have to rotate an SSL certificate on my web site I end-up spending a few hours going through proper steps to generate necessary files and convert them between formats. Since I only do so once a year I never bothered documenting the process. Now, for my own sake, I will publish this post to help folks who have similar needs. My web service is deployed to IIS which consumes certificates in PFX format. However, my certification authority issues certificates in CRT format. Natural question is how to get one converted into another? We will be using OpenSSL for...

posted @ Tuesday, March 22, 2016 1:12 PM

How to debug HTTP 404 from WebResource.axd

I have just refactored a large portion of the web site code, which included moving resources around and in some cases renaming them. Of course such a change can't go without a glitch the first time you fire up a portal after refactoring. As expected, I immediately started hitting a few HTTP 404 responses on WebResource.axd calls. Natural question is - which resources are incorrectly referenced? Unfortunately WebResource.axd URLs are encrypted. Looking at URL itself does no good. Unfortunately there's nothing on the web about debugging specific WebResource.axd failures so I decided to share my trick and hopefully it will...

posted @ Sunday, November 02, 2014 5:05 PM | Feedback (0)

Base32 Encoder and Decoder in C#

Recently I faced a need to convert regular byte array to Base32 and back. Having searched internet I didn't find a reliable converter. Some had bugs and some were good only one way but not the other. Hence I ended up writing my own. Turned out it wasn't that hard. This code is available under Creative Commons Attribution license using System; using System.Text; namespace Utilities { /// <summary> /// Class used for conversion between byte array and Base32 notation /// </summary> internal sealed class Base32 { ...

posted @ Saturday, February 15, 2014 9:10 AM | Feedback (1)

SQL Server 2012: Configuring AlwaysOn Read-Only Routing

SQL Server 2012 contains an amazing HA/DR improvement over Database Mirroring technology - AlwaysOn. It provides an ability to split application workflows into Writing and Reading and send them to different SQL Server instances thus improve hardware utilization and increase throughput. Application can declare the type of queries it executes by adding a connection string keyword "ApplicationIntent". This keyword is supported by all SQL Server 2012 clients: SQL Server Native Client 11.0 ODBC driver, SQLNCLI11 OLE DB provider, JDBC and SqlClient (ADO.NET). This keyword can have one of two values: ReadOnly or ReadWrite. By default application is considered writing and...

posted @ Wednesday, January 25, 2012 4:21 PM | Feedback (18)

Microsoft OLE DB deprecation

Recently Microsoft announced in a blog post that it is deprecating OLE DB stack in SQL Server Native Client and shifting focus to ODBC. Given that I own SQL Server Native Client product at Microsoft I'd like to take a few minutes to clarify what is actually happening and why industry shouldn't panic. After reading original blog post and various interpretations by different people on the internet one might think that OLE DB as technology is being deprecated. This isn't true. Only a concrete implementation is being deprecated, namely SQL Server Native Client's OLE DB stack. If you are familiar with...

posted @ Friday, September 09, 2011 7:51 PM | Feedback (1)

SQL Server - WMI Error 0x80041010 - Invalid Class

Recently I started experiencing WMI repository corruption that results in inability to open SQL Server Configuration Manager with the following error message: Cannot connect to WMI provider. You do not have permission or the server is unreachable. Note that you can only manage SQL Server 2005 and later servers with SQL Server Configuration Manager. Invalid class [0x80041010] At this point if I browse WMI repository under root\microsoft\sqlserver\computermanagement11 I see no SQL Server-specific classes. Only system classes exist. To resolve this issue SQL Server WMI provider needs to be reinstalled. Step 1 - Install classes Navigate to C:\Program Files (x86)\Microsoft SQL Server\<SQL Server version, for example "110"...

posted @ Tuesday, December 07, 2010 9:47 AM | Feedback (1)

SQL Server 2005 and Service Broker

I got a couple of spare minutes while my tests are running. I'd like to use this time to share with you a simple but painful situation I have every time I need to verify Service Broker regressions in the internal SQL Server builds. According to official Microsoft web site we supply Service Broker in Enterprise SKU for sure. However our internal test build has this feature disabled by default. I spent pretty much time exploring the options to get it enabled. Basically, there are 2 probems: 1. Service Broker endpoint is not configured. To resolve this problem you need connect to the...

posted @ Friday, December 21, 2007 3:49 PM | Feedback (6)