Wednesday, August 29, 2007

Self Signing Certificate for IIS

Create a self signing certificate for IIS

VS2005 provides tools to do this which is called makecert and pvk2pfx. First all you need to do is run the following batch file and specify a name for it.

For example

yourBatchFile.bat testCert

The content of batch file is as follows

makecert -r -pe -n "CN=testCert" -sky exchange -sv %1.pvk %1.cer
pvk2pfx -pvk %1.pvk -spc %1.cer -pfx %1.pfx

Once you have this installed, please goto

Start->Run->MMC->File->Add SnapIn->Add->Certificates


A wizard will appear asking you the scope of your certificates. Choose Computer account and Finish.

Select Local Computer and again click Finish. Click Close and then OK.

This will bring you to a Certificates Console.

Expand Personal -> Certificates, right click and select Import
.

The wizard will prompt you for the certificate that you have generate earlier. Provide the test.pfx. When ask for password click Next, Next and Finish.

You need to repeat the same process for Trusted Root Certification Authorities. Expand Certificates and look for Trusted Root Certification Authorities. Under All Task -> Import.

You need to choose testCert.pfx as well.


Configuring IIS


Go to IIS -> Default Web Site -> Properties ->Directory Security -> Server Certicate -> Assign Existing Certificate -> Select testCert -> Click Next and Finsih

The batch file generates an identity for you under the keyword "CN=testCert".
This means that if user where to type in something like www.testCert.com this certificate will be able to validate that it is a legitimate site.


At this point you can use SSL Diagnostic tool for your test to see if you have install your Certificate correctly.



Please proceed to change your hosts file. It can be found under Windows\System32\Drivers\etc\hosts.

Add an entry like the following.

127.0.0.1 testCert


Save it and then you can test out your SSL enabled by firing up your browser and type in the following.

https://www.testCert.com/yourTestSample

yourTestSample is a valid virtual directory in IIS.


That's it and you can use the following setup for CardSpace.

Thursday, August 02, 2007

Document

Start from the top

Page DocTypes

Setting your page rendering mode. What is the use of docTypes?
It basically tells the browser which version of html that will be used to render your page.
There are many variation which includes

a) strict
b) loose
c) frameset
d) xhtml1-strict
e) xhtml1-transitional.dtd
f) xhtml1-frameset.dtd
g) declaration for html 3.2 and 2.0

http://htmlhelp.com/tools/validator/doctype.html

Determine your page Layout.

It is crucial to determine your page layout first and then test it with different browser to see if the positioning is correctly done.

Use minimal Table in your page More Div + CSS

There should be only one level table in your page. Putting two level of table is something you might need to consider twice.


For positioning, formatting that the job of CSS

Follow the XHTML convention and apply the final touches to it by using WC3 Validator service
http://validator.w3.org/

CSS should be used to align your text, phase out the use of spacer gifs and

Make your page conform to XHTML

Try to convert all your html into XHTML compliant standard. It's really easy to do. There should be no upper case for example
changed to
, notice the ending class at the back. These are the convention used in XHTML.

Javascript incompatibility list

Use javascript code that complies to standards.

Use the following as compare to:

a) document.getElementById - instead of document.layers (Netscape) or document.all (IE)

There should be a fair fix of javascript implementation in your page. If your browser host an abundance of javascript code then it might slow down the browser.

And most importantly try to explore other tool to help you do you work .....testing hundreds of page is no easy job.

You might want to try this out

http://www.websiteoptimization.com/services/analyze/

Mozilla Web Developer Pack - add on to Mozilla

Firebug - add on in Mozilla

Validator from WC3

Once of my current task right now is to make my existing web page faster by optimizing html, xhtml and css (with the exception of javascript). I really wonder how fast is that gonna get me.