By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,617 Members | 1,792 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,617 IT Pros & Developers. It's quick & easy.

Self hosting WebService with SSL transport layer security

P: n/a
Hi!

I'm trying to get a WebService running (self hosting, without IIS) that
uses SSL and loads the SSL key/certificate from a file (without using
httpcfg.exe).

I have a running service and netstat shows a listening https interface,
but I can't access the service or the wsdl meta data.

Any ideas, what's going wrong here (see code below)?

Regards,

Tobias

That's what I've done so far:

class Program
{
static void Main(string[] args)
{
ServiceHost host = new ServiceHost(typeof(SoapService));
host.Credentials.ServiceCertificate.Certificate =
new X509Certificate2("Server.pfx", "");
host.Open();
Console.WriteLine("Service is running....");
Console.ReadLine();
}
}

<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="bindingWithTransportSecurity">
<security mode="Transport">
<transport clientCredentialType="None" />
</security>
</binding>
</basicHttpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior name="SoapServiceBehavior">
<serviceMetadata httpsGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
</serviceBehaviors>
</behaviors>
<services>
<service behaviorConfiguration="SoapServiceBehavior"
name="ServiceTest.SoapService">
<endpoint address=""
binding="basicHttpBinding"
bindingConfiguration="bindingWithTransportSecurity "
contract="ServiceTest.ISoapService" />
<endpoint address="mex"
binding="mexHttpsBinding"
contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="https://localhost/servicetest" />
</baseAddresses>
</host>
</service>
</services>
</system.serviceModel>

The certificate is created this way:

makecert -r -pe -n "CN=MYSERVER" -b 01/01/2007 -e 01/01/2010 -sky
exchange Server.cer -sv Server.pvk
pvk2pfx.exe -pvk Server.pvk -spc Server.cer -pfx Server.pfx
Jul 25 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
I'm trying to get a WebService running (self hosting, without IIS) that
uses SSL and loads the SSL key/certificate from a file (without using
httpcfg.exe).
No ideas? Anyone?

Tobias
Jul 30 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.