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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T01:14:44+00:00 2026-05-16T01:14:44+00:00

Im creating a simple WCF service for receiving crash reports. The service will run

  • 0

Im creating a simple WCF service for receiving crash reports.

The service will run self-hosted as a console program and must run without any installation of certificates.

Security-wise i need to ensure that the data send by the client is only send to our server and that the data is not intercepted. From the server point of view i would also like to ensure that the connecting client is using a specific certificate (embedded in the client assembly) to discourage abuse of the service.

I have created a single self-signed certificate and plan to embed the .cer (containing the public part of the certificate) in the client assembly and embed the PFX containing the certificate with the private key into the service host program assembly. (I was led to believe by this that i could use a single certificate).

My problem is that no matter how is setup this up i get the following error:

“An error occurred while making the HTTP request to https://localhost:8080/errorservice. This could be due to the fact that the server certificate is not configured properly with HTTP.SYS in the HTTPS case. This could also be caused by a mismatch of the security binding between the client and the server.”

There shouldnt be a mismatch between the bindings, as they are created using the same code:

public static BasicHttpBinding CreateStreamingBinding() {
  BasicHttpBinding streamBinding = new BasicHttpBinding();
  streamBinding.TransferMode = TransferMode.StreamedRequest;
  streamBinding.MaxReceivedMessageSize = long.MaxValue;
  streamBinding.Security = new BasicHttpSecurity
  {
    Transport = new HttpTransportSecurity 
    {
      ClientCredentialType = HttpClientCredentialType.None,
      ProxyCredentialType =HttpProxyCredentialType.None
    },
    Mode = BasicHttpSecurityMode.Transport,
  };
  streamBinding.MaxBufferSize = int.MaxValue;
  streamBinding.MessageEncoding = WSMessageEncoding.Mtom;
  streamBinding.SendTimeout = new TimeSpan( 1, 0, 0, 0, 0 );
  streamBinding.ReceiveTimeout = new TimeSpan( 1, 0, 0, 0, 0 );
  return streamBinding;
}

On the client the code to create service is setup like this (the certificate location is just for testing):

protected ErrorReportingServiceClient CreateClient() {
  X509Certificate2 cert = new X509Certificate2( @"C:\certs\reporting.cer" );

  EndpointAddress endpointAddress = new EndpointAddress( new Uri( ReportingServiceUri ));

  ErrorReportingServiceClient client =  new ErrorReportingServiceClient( CreateStreamingBinding(), endpointAddress );
  client.ClientCredentials.ServiceCertificate.DefaultCertificate = cert;
  client.ClientCredentials.ServiceCertificate.Authentication.CertificateValidationMode = X509CertificateValidationMode.None;
  client.ClientCredentials.ClientCertificate.Certificate = cert;

  return client;
}

On the service side the setup is as follows:

    X509Certificate2 cert = new X509Certificate2( @"C:\certs\reporting.pfx", <password>);
    BasicHttpBinding basicHttpBinding = CreateStreamingBinding();
    host.Credentials.ClientCertificate.Certificate = cert;
    host.Credentials.ClientCertificate.Authentication.CertificateValidationMode = X509CertificateValidationMode.None;
    host.Credentials.ServiceCertificate.Certificate = cert;

    host.AddServiceEndpoint( contractType, basicHttpBinding, baseAddress );

Any help on how to setup this correctly would be greatly appreciated.

  • 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-16T01:14:45+00:00Added an answer on May 16, 2026 at 1:14 am

    The question was answered on the MSDN forums:
    http://social.msdn.microsoft.com/Forums/en-US/wcf/thread/14f44296-5e3d-4df5-8cc4-a185415852b7

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

Sidebar

Related Questions

Let say I have the following desire, to simplify the IConvertible's to allow me
I have a new web app that is packaged as a WAR as part
I want the messagebox to only show if the number is equal to 0.

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.