Daily Archives: May 26, 2006

The misnomer of SSL Certificates

This has always been a big point of confusion, both for developers (like me) and admins.

SSL Certificates are misnamed. They are not for SSL only. I wish all of the CA’s would just call them “Web Server Certificates”. How and where you install them determines whether or not they are used for SSL.

I remember my first conversation with tech support at Verisign trying to find out how much one cost. This was when I was playing with WSE 1.0. I was extremely clueless. The conversation went something like this:

me: I’m trying to find a server certificate to use for Web Service Enhancements

them: huh?

me: I think it’s just called a “web server certificate”. You have SSL certificates, but I don’t want SSL. I’m not doing SSL.

them: huh?

It went on for a while.

I finally learned that the trick was just to buy an SSL cert, install it on the server and don’t bother with the IIS intallation of it. That’s what I do.

I couldn’t figure out how to explain this to an i.t. person who is used to SSL. They were very wary of installing it on the web server because I wanted to do something wierd with it.

With WS-Security picking up more steam and WCF around the corner, I think thre are going to be many conversations like this in the future. If they just called them Web Server Certificates, it would prevent a lot of frustration out there in the world of web service developers.

Don’t Forget: www.acehaid.org

How FAJAX saved my website – goodbye refresh flashing!

I remember Steven Smith sitting right here in my office over in the LazyBoy chair behind me a few winters ago suddenly saying “wow, look at this cool effect” and showed me a website that had pages fade in and out of each other. By the next day ASPAlliance had the same effect!

You see it a lot on sites now. Leon Bambrick wrote a funny post showing how the use of this can eliminate most of the awful page refresh flashes. He called it FAJAX (as in Fake AJAX), since it accomplishes in two lines of html much of what AJAX is aiming for.

I have spent a lot of time fiddling with the new VTdotNET v.2 site’s caching and performance. Not that I expect Amazon.com-like usage, but it’s my learning playground. But in the end I still had those godawful flashes with the entire screen, even what should look static between pages, blanking out when I went from one page to another.

So I just went over to Leon’s site, googled AJAX and found that post quickly.

After implementing FAJAX, it made a 100% difference!



Don’t Forget: www.acehaid.org

Using your own sql database for ASP.NET 2.0 membership

I seem to be getting this question through my blog and elsewhere often enough to justify a post about it even though there are many great (and more detailed) articles on this topic.

How do you use your own SQL database for ASP.NET 2.0 Membership instead of the default SQLExpress database.

The default db is configured under the covers as a membership provider. What you need to do is override this in web.config. Note that you will have to do this for roles and personalization as well if you are using that.

Start by ensuring that your connection string is set up in web.config.

    <connectionStrings>
        <add name=”MySQLConnection” connectionString=”server=MyServer;Trusted_Connection=true;database=myDB”/>
    </connectionStrings>

Inside of the <system.web> section, you need a membership provider section. I am using code from this msdn document as a base. The membership section is told to use the provider named SqlProvider as the default. This provider is defined inside of the inner section “providers”. The “remove name” element gets rid of the that AspNetSqlProvider that is set up by default when you start configuring membership in the ASPNet Web Site Tool. Then the provider with the name SqlProvider is created. You can create many providers if you like. 

Drilling further in, notice hat this provider is pointing to the System.Web.Security.SqlMembershipProvider class. That tells the provider what implemenation to follow. That is where everything abou memebership happens such as logging in, getting users, etc. You can even extend the existing providers or just write your own. In that case, you would have your own class as the value of the type for the provider.

Next you will see a ConnectionStringName parameter. This is where you plug in the name of the ConnectionString that you created above.

        <membership
             defaultProvider=”SqlProvider”
             userIsOnlineTimeWindow=”20″>
             <providers>
                <remove name=”AspNetSqlProvider” />
                <add name=”SqlProvider”
                    type=”System.Web.Security.SqlMembershipProvider”
                    connectionStringName=”MySQLConnection”
                    enablePasswordRetrieval=”false”
                    enablePasswordReset=”true”
                    requiresQuestionAndAnswer=”true”
                    passwordFormat=”Hashed”
                    applicationName=”/” />
            </providers>
        </membership>
    </system.web>
</configuration>

Note that if you are using roles or personalization in your site and you want that to be tied to your database as well, you will need to similarly configure

<roleManager>
  <providers …>
</roles>

and

<webParts>
  <personalization>
     <providers …>
  </personalization>
</webParts>

That should get you started!



Don’t Forget: www.acehaid.org