はい、もちろん - ただし、(トランスポート セキュリティではなく) メッセージ セキュリティを使用している場合に限ります。次のようにバインディング構成を定義します。
<netTcpBinding>
<binding name="UserNameSecurity">
<security mode="Message">
<message clientCredentialType="UserName"/>
</security>
</binding>
</netTcpBinding>
次に、エンドポイント (サーバーとクライアント) でそのバインド構成を参照します。
<endpoint address="....."
binding="netTcpBinding"
bindingConfiguration="UserNameSecurity"
contract="IMyService" />
マルク
更新:
ああ、はい、サーバー側では、それを呼び出すクライアントに対してサービスを認証するための証明書が必要です。また、メッセージの暗号化と署名にも使用されます。これはサーバー上のみです。クライアントは何もインストールする必要はありません。
構成:
<behaviors>
<serviceBehavior>
<behavior name="ServerInternet">
<serviceCredentials>
<serviceCertificate
findValue="MyServiceCertificate"
storeLocation="LocalMachine"
storeName="My"
x509FindType="FindBySubjectName" />
</serviceCredentials>
</behavior>
</serviceBehavior>
</behaviors>
<services>
<service name="MyServiceInternet"
behaviorConfiguration="ServerInternet">
....
</service>
</services>
サーバーの証明書を、構成で指定した「サブジェクト名」の下のサーバーの「ローカル マシン」フォルダーにインストールしてください。