2012-04-23 27 views
1

xml構成ファイルと.exe(完全な解決策ではない)のみを使用するWCFサービスがあります。既存のエンドポイントをhttpsで安全にすることはできますか? もしそうなら、私はこれをどうやって行うことができ、どのようにネットワーク上の別のPCにある私のクライアントと接続することができますか?XML設定ファイルのみを使用したWCFサービスのSSLエンドポイント

これは私のサービスのXML設定を次のようになります。 私はバインディング:

<wsHttpBinding> 
    <binding 
     name="HighQuotaWSHttpBinding" 
     receiveTimeout="00:10:00" 
     sendTimeout="00:10:00" 
     bypassProxyOnLocal="true" 
     maxBufferPoolSize="2147483647" 
     useDefaultWebProxy="false" 
     maxReceivedMessageSize="2147483647"> 
     <security mode="Transport"> 
     <transport clientCredentialType="None" /> 
     </security> 
    </binding> 
    </wsHttpBinding> 

私のエンドポイント:

<service 
    behaviorConfiguration="WebDataServiceBehaviour" 
    name="Humiq.Integral.WebDataService.Impl.ServiceLayer.WcfLibrary.WebDataService"> 
    <endpoint 
     address="WebDataService" 
     binding="wsHttpBinding" bindingConfiguration="HighQuotaWSHttpBinding" 
     contract="Humiq.Integral.WebDataService.Intf.ServiceLayer.IWebDataService" 
     name="WebDataServiceHttpBinding"> 
     <identity> 
     <dns value="localhost" /> 
     </identity> 
    </endpoint> 
    <endpoint 
     address="mex" 
     binding="mexHttpsBinding" 
     contract="IMetadataExchange" 
     name="mexManagement" /> 
    <host> 
     <baseAddresses> 
     <add baseAddress="http://mylocalip:9650/" /> 
     <add baseAddress="https://mylocalip:9651/" /> 
     </baseAddresses> 
    </host> 
    </service> 

行動:

<behaviors> 
    <serviceBehaviors> 
    <!-- Behavior for WebserviceData interface --> 
    <behavior name="WebDataServiceBehaviour"> 
     <!-- Set throttling of (concurrent) cals --> 
     <serviceThrottling 
     maxConcurrentCalls="100" 
     maxConcurrentSessions="100" 
     maxConcurrentInstances="100"/> 
     <!-- To avoid disclosing metadata information, 
     set the value below to false and remove the metadata endpoint above before deployment --> 
     <serviceMetadata httpsGetEnabled="True"/> 
     <!-- To receive exception details in faults for debugging purposes, 
     set the value below to true. Set to false before deployment 
     to avoid disclosing exception information --> 
     <serviceDebug includeExceptionDetailInFaults="True" /> 
     <dataContractSerializer maxItemsInObjectGraph="2147483646"/> 
    </behavior> 
    </serviceBehaviors> 
</behaviors> 

そして、これは私のクライアントです:

<bindings> 
     <wsHttpBinding> 
      <binding name="WebDataServiceHttpBinding" closeTimeout="00:01:00" 
       openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" 
       bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard" 
       maxBufferPoolSize="524288" maxReceivedMessageSize="65536" 
       messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true" 
       allowCookies="false"> 
       <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" 
        maxBytesPerRead="4096" maxNameTableCharCount="16384" /> 
       <reliableSession ordered="true" inactivityTimeout="00:10:00" 
        enabled="false" /> 
       <security mode="Transport"> 
        <transport clientCredentialType="Basic" proxyCredentialType="None" 
         realm="" /> 
        <message clientCredentialType="Windows" negotiateServiceCredential="true" /> 
       </security> 
      </binding> 
     </wsHttpBinding> 
    </bindings> 
    <client> 
     <endpoint address="https://mylocalip:9651/WebDataService" binding="wsHttpBinding" 
      bindingConfiguration="WebDataServiceHttpBinding" contract="wcf1.IWebDataService" 
      name="WebDataServiceHttpBinding"> 
      <identity> 
       <dns value="localhost" /> 
      </identity> 
     </endpoint> 
    </client> 
+0

のApp.configファイルまたはWeb.config:それはnetshコマンドを使って行われ

、あなたはその助けを読むことができますか? I.o.wそれはどのようにホストされていますか? –

+0

これはXML設定ファイルです。それは同じネットワーク上のPC上でホストされています。 – user1350954

+0

それは私の質問のいずれにも答えません。 –

答えて

0

Windowsでsslを使用するには、ポートを定義する必要があります。

netsh http add sslcert ipport=0.0.0.0:8732 certhash=4745537760840034c3dea27f940a269b7d470114 appid={00112233-4455-6677-8899-AABBCCDDEEFF} 
+0

これは既に完了しています – user1350954

+0

サービスを開始することができますか? –

+0

はいサービスを開始できますか?コンソールにクライアント証明書が提供されていないというメッセージが表示されます – user1350954

関連する問題