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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T09:06:16+00:00 2026-06-17T09:06:16+00:00

I run a self-hosted WCF service which I want to protect with self-signed SSL

  • 0

I run a self-hosted WCF service which I want to protect with self-signed SSL certificate. For that to work I need to bind this SSL certificate with certain port. There are couple ways of doing it:

  1. According to this http://msdn.microsoft.com/en-us/library/ms733791.aspx I can use netsh and it works but I would like not to have dependencies on the netsh and do everything from the .NET code.

  2. So I found the following snippet:

        using (ServerManager manager = new ServerManager())
        {
            Site site = manager.Sites.FirstOrDefault(i => i.Applications.Cast<Application>().Any());
            Application app = site.Applications.Cast<Application>().First();
            site.Bindings.Add(":*:PORTN", cert.GetCertHash(), store.Name);
            manager.CommitChanges();
        }
    

It works, however this required IIS to be installed. Otherwise I’m getting the following exception:

Retrieving the COM class factory for component with CLSID
{2B72133B-3F5B-4602-8952-803546CE3344} failed due to the following
error: 80040154 Class not registered (Exception from HRESULT:
0x80040154 (REGDB_E_CLASSNOTREG))..

So, question is – is there any way to accomplish this inside managed code, but without having to install IIS?

  • 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-06-17T09:06:17+00:00Added an answer on June 17, 2026 at 9:06 am

    Found the correct answer to my question: Binding an SSL certificate to a port programmatically

    Instead of using managed classes like ServerManager I would need to rely on P/Invoking native API such as HttpSetServiceConfiguration.

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

Sidebar

Related Questions

I have a console app that runs a self hosted WCF Data Service. I
I've got a self hosted WCF service, and an ASP .Net web site that
here's the setup for the project. I have a WCF Service that is hosted
I have a self-hosted WCF that runs under network_service beautifully on \Server1, but needs
I've successfully implemented a self-hosted WCF service. For legacy matters, the host binding configuration
I am creating a wcf self hosted service. I am using UriTemplate class to
I have a self-hosted WCF web service running, and an Android client application. I
Is there way to run self host a WCF service with ServiceHost on local
I've got a net.tcp WCF service running in a self-hosted environment. I've setup a
I have a Clustered MSMQ I also have a WCF service app (Self hosted

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.