How to configure transport encryption when using net.tcp?
See original GitHub issueI would like to migrate an existing service from WCF to CoreWCF. The service uses a certificate (from Windows Cert Store). In WCF this is done via behavior in config file:
<serviceBehaviors>
<behavior name="UseMyCert">
<serviceCredentials>
<serviceCertificate x509FindType="FindByIssuerName" findValue="MY ISSUING CA"/>
</serviceCredentials>
</behavior>
</serviceBehaviors>
<binding name="streamedSecureTcp" transferMode="Streamed">
<security mode="Transport">
<transport clientCredentialType="None" />
</security>
</binding>
<service behaviorConfiguration="UseMyCert" name="MyNamespace.MyService">
<endpoint address="net.tcp://localhost:800/MyService.svc"
binding="netTcpBinding"
bindingConfiguration="streamedSecureTcp"
name="MyServer" bindingNamespace="http://my.com/service"
contract="MyNamespace.IMyService" />
</service>
How can this be done in CoreWCF? Providing the certificate as file would also be ok.
Issue Analytics
- State:
- Created 3 years ago
- Comments:16 (10 by maintainers)
Top GitHub Comments
Apparently, this didn’t make it into 0.1.0.
I have applied this patch in my local copy. It also required to implement
IServiceDispatcher.ChannelDispatcher
in a few other classes, did that with placeholders, throwing not implemented.It now does work! 😎
With minimal edits, it seemed logical to me to do this: 023be93b5259911726bd461b9a04df731148681b. It fixes the
InvalidOperationException 'The service certificate is not provided. Specify a service certificate in ServiceCredentials.'
on host.Run(). Judging by theFind()
inSslStreamSecurityUpgradeProvider.CreateServerProvider(...)
, this should be the correct way to do it. I’m also not so sure about changingIServiceDispatcher
, so I’d like hear some feedback.The Eco example works (as expected), without modifying anything else (apart from
Startup
, and adding the certificate of course).