SSL Authentication in .net

what is ssl:



<endpoint address=”” binding=”basicHttpBinding” bindingConfiguration=”SvcSoap” contract=”A.SvcSoap” name=”SvcSoapSSLAuthForDEV”/>



<!--For SSL--> <binding name="SvcSoap"> <security mode="Transport"> <transport clientCredentialType="Certificate"/> </security> </binding>


THen in code,

                string CertThumbprint = parameters["CertThumbprint"];
                string endpoint = parameters["endpoint"];
                string Environment = ExternalConfigSection.AppSettings["ConfigPath"];
                string EndPointConfigurationName = "SvcSoapSSLAuthForDEV";
                var svc = new GetFieldsMulRecSoapClient(EndPointConfigurationName, endpoint);
                svc.ClientCredentials.ClientCertificate.SetCertificate(StoreLocation.LocalMachine, StoreName.My,
                                                                       X509FindType.FindByThumbprint, CertThumbprint);
// Now you can call the service like any other service...

protected void validateCert()
            string Environment = ExternalConfigSection.AppSettings["ConfigPath"];
                // trust sender
                ServicePointManager.ServerCertificateValidationCallback =
                    ((sender, cert, chain, errors) => cert.Subject.Contains("subjectOfCert CN"));      //VALIDATE THE SUBJECT OF THE SERVICE CERT  

 1 Make sure that the caller cert is installed in Local Machine-> Personal store and the called service's cert is installed in Local Machine->Trusted People store.
 2 Make sure the root certs of both the certs above is installed in Local Machine-> Trusted Root Cert Authorities store

C# 5.0 in a Nutshell, 5th Edition : C# 5.0 in a Nutshell, 5th Edition : Head First Design Patterns

CODE of C# 5.0 in a Nutshell, 5th Edition is at:


reimplementation hijacking is effective only when a
member is called through the interface and not through the base class. This is usually
undesirable as it can mean inconsistent semantics. This makes reimplementation
most appropriate as a strategy for overriding explicitly implemented interface

Generics, when compared to inheritance, can increase type safety and reduce
casting and boxing.

must assign a value:
ref – before call the method
out – inside the method

Methods and types are the only constructs that can introduce type parameters.
Properties, indexers, events, fields, constructors, operators, and so on cannot declare
type parameters, although they can partake in any type parameters already declared
by their enclosing type.
Type parameters can be introduced in the declaration of classes, structs, interfaces,
delegates, and methods. Other constructs, such as properties,
cannot introduce a type parameter, but can use one.
Generic type names and method names can be overloaded as long as the number of
type parameters is different.
it is possible for an unbound generic type to exist at runtime
—purely as a Type object. The only way to specify an unbound generic type in C#
is with the typeof operator
The default keyword can be used to get the default value given a generic type parameter.
The default value for a reference type is null, and the default value for a
value type is the result of bitwise-zeroing the value type’s fields
These are the possible constraints:
where T : base-class // Base-class constraint
where T : interface // Interface constraint
where T : class // Reference-type constraint
where T : struct // Value-type constraint (excludes Nullable types)
where T : new() // Parameterless constructor constraint
where U : T // Naked type constraint
A subtype can also introduce fresh type arguments
The decision as to which kind of conversion will take place happens at compile
time, based on the known types of the operands. This creates an interesting scenario
with generic type parameters, because the precise operand types are unknown at
compile time. If this leads to ambiguity, the compiler generates an error.

as vs implicit or explicit cast is that as does not throw exception…

Assuming A is convertible to B, X is covariant if X<A> is convertible to X<B>.
“convertible” means convertible via an implicit reference conversion



Debugging Multiple Solutions simultaneously in VS

Hi,This was the 1st requirement of my proj.

the project is a dll and its classes are invoked by machine config…hence it intercepts all apps…

To debug :

Open the soln in VS and host it on the VS Server (by default u should host VS apps in IIS only –unless  u want to debug— but then if u want to debug multiple apps, u need to host all on VS but 1 and run all from iis and attach the one to the asp_wp from the VS Debug menu.

The beginning and the end of CSS Gradient (for me)

This is the first and the last time that i used Gradient in my project  :

.css({ background: “-webkit-gradient(linear, left top, left bottom, from(#ccc), to(#728C00))” }).css(‘font-weight’, ‘bold’);  

Here’s how it looks:
Now this is the same thing without gradient:

Which one looks better to you ?

Its always been the latter one that appeals to me…

Maybe i’ve been influenced by the iOS and Windows 8 color and UI scheme, but i would never use gradient ever again…unless someone pays me to use it 🙂

windows 8 theme for windows 7