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 7188897
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T19:11:10+00:00 2026-05-28T19:11:10+00:00

I created a wcf services, hosted it in IIS(7.5) which works fine. I now

  • 0

I created a wcf services, hosted it in IIS(7.5) which works fine. I now want to add username authentication and i run into some problems.
The config file is this:

  <system.serviceModel>
    <services>
      <service behaviorConfiguration="warServBehavior" name="WcfServiceLibrary.WarcraftService">
        <endpoint address="" binding="wsHttpBinding" contract="WcfServiceLibrary.IWarcraftService" bindingConfiguration="warWsHttpBinding" />
        <endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange" />
      </service>
    </services>
    <bindings>
      <wsHttpBinding>
        <binding name="warWsHttpBinding">
          <security mode="TransportWithMessageCredential">
            <transport clientCredentialType="None"/>
            <message clientCredentialType="UserName"/>
          </security>
        </binding>
      </wsHttpBinding>
    </bindings>
    <behaviors>
      <serviceBehaviors>
        <behavior name="warServBehavior">
          <serviceMetadata httpGetEnabled="false" httpsGetEnabled="true" />
          <serviceDebug includeExceptionDetailInFaults="true"/>
          <serviceCredentials>
            <userNameAuthentication userNamePasswordValidationMode="Custom" customUserNamePasswordValidatorType="BogusValidator, App_Code"/>
          </serviceCredentials>
        </behavior>
      </serviceBehaviors>
    </behaviors>
  </system.serviceModel>

Regarding the certificate i did the following(inspired from msdn):

  1. 1)makecert -n “CN=RootCATest” -r -sv RootCATest.pvk RootCATest.cer

  2. 2)added it to Trusted Root Certification Authorities

  3. 3)makecert -sk CertTest -iv RootCATest.pvk -n “CN=Bogus” -ic RootCATest.cer -sr
    localmachine -ss my -sky exchange -pe

In IIS i added binding for https and in the Server Certificates i have this:
enter image description here

When i run svcutil https://localhost/WarcraftServiceSite/WarService.svc i get this exception: "There was an error downloading https://localhost/WarcraftServiceSite/WarService.svc. The underlying connection was closed.Could not establish trust relationship for the SSL/TLS secure channel. The remote certificate is invalid according to the validation procedure."

Later edit: it seems that the right way to call svcutil is with http not https even though i have this <serviceMetadata httpGetEnabled="false" httpsGetEnabled="true" />

  • 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-28T19:11:11+00:00Added an answer on May 28, 2026 at 7:11 pm

    Because this is just a test certificate you can add the following to the client for it to work. When you get a production certificate from verisign etc you won’t need this.
    Reference and add usings for the following – System.Net, System.Net.Security, System.Security.Cryptography.X509Certificates;

    Use the ServicePointManager class and add a handler to the ServerCertificateValidationCallback

      ServicePointManager.ServerCertificateValidationCallback
                   += RemoteCertificateValidate;
    

    Then the handler impl

    private static bool RemoteCertificateValidate(
       object sender, X509Certificate cert, 
        X509Chain chain, SslPolicyErrors error)
    {
        // trust any certificate
        return true;
    }
    

    Wire up the handler somewhere before using your proxy.
    Remeber this code and certs from makecert should be used for testing only.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I created a WCF Serice that worked fine when hosted on IIS. now, I
I have IIS-Hosted WCF application and services. I want to automate the process to
I've got some WCF services (hosted in IIS 6) which use the Enterprise Library
I have a WCF service which will be hosted under IIS. Now I have
I want to ask a question about IIS hosted Wcf Services. Our projects has
I have a WCF Service Using MSMQ hosted on IIS. I want to create
We have created a WCF service hosted in a windows service that handles Authentication
I've successfully created a WCF service that works how I want it to. The
I have a WCF service hosted at local IIS. I created a ASP.NET website
I have a WCF service which is hosted in IIS 7.0/7.5 inside of a

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.