Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6971835
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T16:53:25+00:00 2026-05-27T16:53:25+00:00

I know that SSL certificate is used for security purpose of application so that

  • 0

I know that SSL certificate is used for security purpose of application so that data transfer should be in encrypted form.As per my knowledge we have to install SSL certificate in host server for our application.

These days i am working in WCF service. Client want us to make WCF service with SSL certificate.

What i want to know that is there any need to do in code level for SSL certificate. I am going to host my service in IIS.

What are the steps for configuring WCF service with SSL certificate?

I know little knowledge is always dangerous 🙁

Please elaborate.

Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T16:53:25+00:00Added an answer on May 27, 2026 at 4:53 pm

    In order to configure your service for 2 way SSL below are the steps:

    1. Create a website which has the https binding mapped on it.
    2. When the https binding is mapped to the website it asks for a server SSL certificate that it would use to secure your transport channel.
    3. Create a virtual directory where you want your services to be deployed.
    4. Now the WCF services being built need to have the configuration that specifies that the service uses https and clients are authenticated using certificates.
    5. Set the option to “Accept” on your SSL Settings of your virtual directory which states that the client might pass a certificate. IF you set it to require then the client needs to pass a certificate.

    NOTE: When using certificate you need to be sure on which certificate needs to be installed in which certificate store. You might have some exceptions with self signed certificates but they can be bypassed on client by using the code below:

    ServicePointManager.ServerCertificateValidationCallback = (sender, cert, chain, error) => true;
    

    Some code on how to implement your custom certificate validator and use it:

    public class CustomX509CertificateValidator : System.IdentityModel.Selectors.X509CertificateValidator
        {
            // This Validation function accepts any X.509 Certificate that is self-issued. As anyone can construct such
            // a certificate this custom validator is less secure than the default behavior provided by the
            // ChainTrust X509CertificateValidationMode. The security implications of this should be carefully 
            // considered before using this validation logic in production code. 
            public override void Validate(X509Certificate2 certificate)
            {
                // Check that we have been passed a certificate
                if (certificate == null)
                    throw new ArgumentNullException("certificate");
    
                // Only accept self-issued certificates
                if (certificate.Subject != certificate.Issuer)
                    throw new SecurityTokenException("Certificate is not self-issued");
            }
        }
    

    Now in your WCF service config file to use the custom certificate validator is shown below:

    <behaviors>
          <serviceBehaviors>
            <behavior name="CalculatorServiceBehavior">
              <serviceDebug includeExceptionDetailInFaults="true"/>
              <serviceCredentials>
                <!-- 
                The serviceCredentials behavior allows one to specify authentication constraints on client certificates.
                -->
                <clientCertificate>
                  <!-- 
                  Setting the certificateValidationMode to Custom means that if the custom X509CertificateValidator
                  does NOT throw an exception, then the provided certificate will be trusted without performing any
                  validation beyond that performed by the custom validator. The security implications of this 
                  setting should be carefully considered before using Custom in production code. 
                  -->
                  <authentication certificateValidationMode="Custom" customCertificateValidatorType="X509CertificateValidator.CustomX509CertificateValidator, service"/>
                </clientCertificate>
                <!-- 
                The serviceCredentials behavior allows one to define a service certificate.
                A service certificate is used by a client to authenticate the service and provide message protection.
                This configuration references the "localhost" certificate installed during the setup instructions.
                -->
                <serviceCertificate findValue="localhost" storeLocation="LocalMachine" storeName="My" x509FindType="FindBySubjectName"/>
              </serviceCredentials>
            </behavior>
          </serviceBehaviors>
        </behaviors>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know that we shouldn't being using the registry to store Application Data anymore,
how do you validate the digital certificate SSL? so that you know the response
I know that |DataDirectory| will resolve to App_Data in an ASP.NET application but is
I have created a server application that accepts connections over SSL. It's simple and
I have a web based application that uses a self signed certificate. When you
I'd like to have a SSL certificate for domainA that load images from domainB
I have been asked to build a web application that will be used to
I am new in SSL, whatever i read and know that its paid digital
For an application, I need to have a SSL certificate for a WCF service,
How can I know that, my application (using LDAP/exchange server and Exchange Web Service)

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.