Changeset 1579


Ignore:
Timestamp:
04/16/09 17:44:58 (12 years ago)
Author:
mbecirov
Message:

#528: WCF Service secured - you need to install the certificate in order to run the application properly!

Location:
trunk/sources
Files:
1 deleted
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Hive.Client.Communication/3.2/HeuristicLab.Hive.Client.Communication-3.2.csproj

    r1534 r1579  
    44    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    55    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    6     <ProductVersion>9.0.30729</ProductVersion>
     6    <ProductVersion>9.0.21022</ProductVersion>
    77    <SchemaVersion>2.0</SchemaVersion>
    88    <ProjectGuid>{AEB51212-CDBA-4FC6-A2EE-02359AA53ECE}</ProjectGuid>
     
    9696  </ItemGroup>
    9797  <ItemGroup>
    98     <None Include="app.config" />
    9998    <None Include="HeuristicLab.snk" />
    10099    <None Include="Properties\AssemblyInfo.frame" />
  • trunk/sources/HeuristicLab.Hive.Client.Communication/3.2/WcfService.cs

    r1530 r1579  
    7575      try {
    7676        proxy = new ClientCommunicatorClient(
    77           new NetTcpBinding(SecurityMode.None, true),
     77          WcfSettings.GetBinding(),
    7878          new EndpointAddress("net.tcp://" + ServerIP + ":" + ServerPort + "/HiveServer/ClientCommunicator")
    7979        );
  • trunk/sources/HeuristicLab.Hive.Client.Console/3.2/HeuristicLab.Hive.Client.Console-3.2.csproj

    r1534 r1579  
    44    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    55    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    6     <ProductVersion>9.0.30729</ProductVersion>
     6    <ProductVersion>9.0.21022</ProductVersion>
    77    <SchemaVersion>2.0</SchemaVersion>
    88    <ProjectGuid>{8B14A35E-DBDF-43EB-B019-23E9FBC5A35E}</ProjectGuid>
     
    121121    <EmbeddedResource Include="EventLogEntryForm.resx">
    122122      <DependentUpon>EventLogEntryForm.cs</DependentUpon>
     123      <SubType>Designer</SubType>
    123124    </EmbeddedResource>
    124125    <EmbeddedResource Include="HiveClientConsole.resx">
     
    133134    <EmbeddedResource Include="Recurrence.resx">
    134135      <DependentUpon>Recurrence.cs</DependentUpon>
     136      <SubType>Designer</SubType>
    135137    </EmbeddedResource>
    136138    <Compile Include="Properties\Resources.Designer.cs">
     
    164166  </ItemGroup>
    165167  <ItemGroup>
     168    <ProjectReference Include="..\..\HeuristicLab.Hive.Contracts\3.2\HeuristicLab.Hive.Contracts-3.2.csproj">
     169      <Project>{134F93D7-E7C8-4ECD-9923-7F63259A60D8}</Project>
     170      <Name>HeuristicLab.Hive.Contracts-3.2</Name>
     171    </ProjectReference>
    166172    <ProjectReference Include="..\..\HeuristicLab.PluginInfrastructure\HeuristicLab.PluginInfrastructure.csproj">
    167173      <Project>{94186A6A-5176-4402-AE83-886557B53CCA}</Project>
  • trunk/sources/HeuristicLab.Hive.Client.Console/3.2/HiveClientConsole.cs

    r1530 r1579  
    3131using HeuristicLab.Hive.Client.Console.ClientService;
    3232using ZedGraph;
     33using HeuristicLab.Hive.Contracts;
    3334
    3435namespace HeuristicLab.Hive.Client.Console
     
    108109      try
    109110      {
    110         cccc = new ClientConsoleCommunicatorClient(new NetTcpBinding(), new EndpointAddress(ENDPOINTADRESS));
     111        //changed by MB, 16.04.09
     112        //cccc = new ClientConsoleCommunicatorClient(new NetTcpBinding(), new EndpointAddress(ENDPOINTADRESS));
     113        cccc = new ClientConsoleCommunicatorClient(WcfSettings.GetBinding(), new EndpointAddress(ENDPOINTADRESS));
    111114        cccc.GetStatusInfosCompleted += new EventHandler<GetStatusInfosCompletedEventArgs>(cccc_GetStatusInfosCompleted);
    112115        cccc.GetCurrentConnectionCompleted += new EventHandler<GetCurrentConnectionCompletedEventArgs>(cccc_GetCurrentConnectionCompleted);
  • trunk/sources/HeuristicLab.Hive.Client.Console/3.2/app.config

    r1530 r1579  
    66        </sectionGroup>
    77    </configSections>
    8     <system.serviceModel>
    9         <bindings>
    10             <netTcpBinding>
    11                 <binding name="NetTcpBinding_IClientConsoleCommunicator" closeTimeout="00:01:00"
    12                     openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
    13                     transactionFlow="false" transferMode="Buffered" transactionProtocol="OleTransactions"
    14                     hostNameComparisonMode="StrongWildcard" listenBacklog="10"
    15                     maxBufferPoolSize="524288" maxBufferSize="65536" maxConnections="10"
    16                     maxReceivedMessageSize="65536">
    17                     <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
    18                         maxBytesPerRead="4096" maxNameTableCharCount="16384" />
    19                     <reliableSession ordered="true" inactivityTimeout="00:10:00"
    20                         enabled="false" />
    21                     <security mode="None">
    22                         <transport clientCredentialType="None" protectionLevel="None" />
    23                         <message clientCredentialType="None" />
    24                     </security>
    25                 </binding>
    26             </netTcpBinding>
    27         </bindings>
    28         <client>
    29             <endpoint address="net.tcp://127.0.0.1:8000/ClientConsole/ClientConsoleCommunicator"
    30                 binding="netTcpBinding" bindingConfiguration="NetTcpBinding_IClientConsoleCommunicator"
    31                 contract="ClientService.IClientConsoleCommunicator" name="NetTcpBinding_IClientConsoleCommunicator">
    32                 <identity>
    33                     <userPrincipalName value="mse08026@fhs-hagenberg.ac.at" />
    34                 </identity>
    35             </endpoint>
    36         </client>
    37     </system.serviceModel>
    38     <userSettings>
     8       <userSettings>
    399        <HeuristicLab.Hive.Client.Console.Properties.Settings>
    4010            <setting name="IpAdress" serializeAs="String">
  • trunk/sources/HeuristicLab.Hive.Client.Core/3.2/ClientConsoleService/ClientConsoleServer.cs

    r919 r1579  
    77using HeuristicLab.PluginInfrastructure;
    88using HeuristicLab.Hive.Client.Core.ClientConsoleService.Interfaces;
     9using HeuristicLab.Hive.Contracts;
    910
    1011namespace HeuristicLab.Hive.Client.Core.ClientConsoleService {
     
    3637                  uriTcp);
    3738
    38         System.ServiceModel.Channels.Binding binding =
    39           new NetTcpBinding();
    40 
    4139        serviceHost.AddServiceEndpoint(
    4240          typeof(IClientConsoleCommunicator),
    43               binding,
     41              WcfSettings.GetBinding(),
    4442              "ClientConsoleCommunicator");
    4543
  • trunk/sources/HeuristicLab.Hive.Contracts/3.2/WcfSettings.cs

    r1530 r1579  
    1 using System;
     1#define USE_MSG_BINDING
     2using System;
    23using System.Collections.Generic;
    34using System.Linq;
     
    1112  public static class WcfSettings {
    1213
     14    public const string SERVERCERT = "HIVE-Server";
     15    public const int DEFAULTPORT = 9000;
     16   
     17    /// <summary>
     18    /// Gets a pre-defined binding using TCP for secure transport.
     19    /// </summary>
     20    /// <returns>A binding type of <see cref="NetTcpBinding"/></returns>
    1321    public static Binding GetBinding() {
     22#if USE_MSG_BINDING
    1423      NetTcpBinding binding = new NetTcpBinding(SecurityMode.Message);
     24#else
     25      NetTcpBinding binding = new NetTcpBinding(SecurityMode.TransportWithMessageCredential);
     26      binding.Security.Message.ClientCredentialType = MessageCredentialType.Certificate;
     27#endif
    1528      return binding;
    1629    }
    1730
     31    /// <summary>
     32    /// Defines the used certificate for authentification located in a certification store.
     33    /// </summary>
     34    /// <param name="svchost">A service for which this certificate is applicable.</param>
     35    public static void SetServiceCertificate(ServiceHost svchost) {
     36      svchost.Credentials.ServiceCertificate.SetCertificate(
     37        StoreLocation.LocalMachine,
     38        StoreName.My,
     39        X509FindType.FindBySubjectName,
     40        SERVERCERT);
     41    }
     42
     43    /// <summary>
     44    /// Gets the currently active IP address.
     45    /// <remarks>If more than one IP connections is active, the first one will be used.</remarks>
     46    /// </summary>
     47    /// <returns></returns>
    1848    public static string GetActiveIP() {
    1949      return System.Net.NetworkInformation.IPGlobalProperties.GetIPGlobalProperties().GetActiveTcpConnections()[0].LocalEndPoint.Address.ToString();
    2050    }
    2151
     52    /// <summary>
     53    /// Gets the default port used for HIVE services.
     54    /// </summary>
     55    /// <returns></returns>
    2256    public static int GetDefaultPort() {
    23       return 9000;
     57      return DEFAULTPORT;
    2458    }
    2559  }
    2660
    27   // WARNUNG: Dieser Code wird nur für Testzertifikate benötigt, wie sie beispielsweise von makecert erstellt werden.
    28   // Sie sollten diesen Code nicht in einer Produktionsumgebung verwenden.
     61  /// <summary>
     62  /// This class verifies the certificate defined by <see cref="SetServerCertificate"></see> method. Normally,
     63  /// the verification process is managed by the underlying operating system.
     64  /// </summary>
     65  /// <remarks>
     66  /// WARNUNG: Dieser Code wird nur für Testzertifikate benötigt, wie sie beispielsweise von makecert erstellt werden.
     67  /// Sie sollten diesen Code nicht in einer Produktionsumgebung verwenden.
     68  /// </remarks>
    2969  public class PermissiveCertificatePolicy {
    3070    string subjectName;
     
    4484        return true;
    4585      }
    46 
    4786      return false;
    4887    }
  • trunk/sources/HeuristicLab.Hive.Engine/3.2/HeuristicLab.Hive.Engine-3.2.csproj

    r1534 r1579  
    44    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    55    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    6     <ProductVersion>9.0.30729</ProductVersion>
     6    <ProductVersion>9.0.21022</ProductVersion>
    77    <SchemaVersion>2.0</SchemaVersion>
    88    <ProjectGuid>{C8FEDAC1-0326-4293-B585-F0FEDDEDFC11}</ProjectGuid>
     
    130130    <EmbeddedResource Include="HiveEngineEditor.resx">
    131131      <DependentUpon>HiveEngineEditor.cs</DependentUpon>
     132      <SubType>Designer</SubType>
    132133    </EmbeddedResource>
    133134  </ItemGroup>
  • trunk/sources/HeuristicLab.Hive.Server.Console/3.2/ServiceLocator.cs

    r1530 r1579  
    66using HeuristicLab.Hive.Contracts.Interfaces;
    77using System.ServiceModel;
     8using HeuristicLab.Hive.Contracts;
    89
    910namespace HeuristicLab.Hive.Server.ServerConsole {
     
    2728        Port != String.Empty) {
    2829
    29         NetTcpBinding binding =
    30              new NetTcpBinding(SecurityMode.None, true);
    31 
    32         binding.MaxReceivedMessageSize = 5000000;
     30        //binding.MaxReceivedMessageSize = 5000000;
    3331
    3432        ChannelFactory<IServerConsoleFacade> factory =
    3533          new ChannelFactory<IServerConsoleFacade>(
    36             binding,
     34            WcfSettings.GetBinding(),
    3735            new EndpointAddress("net.tcp://" + Address + ":" + Port + "/HiveServerConsole/ServerConsoleFacade"));
    3836
  • trunk/sources/HeuristicLab.Hive.Server/3.2/HiveServerApplication.cs

    r1530 r1579  
    3636      AutoRestart = true)]
    3737  public class HiveServerApplication : ApplicationBase {
    38     private const int DEFAULT_PORT = 9000;
    3938    public const string STR_ClientCommunicator = "ClientCommunicator";
    4039    public const string STR_ServerConsoleFacade = "ServerConsoleFacade";
     
    4342    private DiscoveryService discService = new DiscoveryService();
    4443    private Dictionary<string, ServiceHost> runningServices = new Dictionary<string, ServiceHost>();
    45     private NetTcpBinding binding = new NetTcpBinding(SecurityMode.None, true);
    46     //private WSHttpBinding binding = new WSHttpBinding(SecurityMode.TransportWithMessageCredential, true);
     44    private NetTcpBinding binding = (NetTcpBinding)WcfSettings.GetBinding();
    4745
    4846    private enum Services {
     
    105103      if ((serviceHost != null) && (!String.IsNullOrEmpty(curServiceHost))) {
    106104        AddMexEndpoint(serviceHost);
     105        WcfSettings.SetServiceCertificate(serviceHost);
    107106        serviceHost.Open();
    108107        runningServices.Add(curServiceHost, serviceHost);
     
    146145      Dictionary<string, Uri> baseAddrDict = new Dictionary<string, Uri>();
    147146      baseAddrDict.Add(STR_ClientCommunicator,
    148         StartService(Services.ClientCommunicator, addresses[index], DEFAULT_PORT));
     147        StartService(Services.ClientCommunicator, addresses[index], WcfSettings.DEFAULTPORT));
    149148      baseAddrDict.Add(STR_ServerConsoleFacade,
    150         StartService(Services.ServerConsoleFacade, addresses[index], DEFAULT_PORT));
     149        StartService(Services.ServerConsoleFacade, addresses[index], WcfSettings.DEFAULTPORT));
    151150      baseAddrDict.Add(STR_ExecutionEngineFacade,
    152         StartService(Services.ExecutionEngineFacade, addresses[index], DEFAULT_PORT));
     151        StartService(Services.ExecutionEngineFacade, addresses[index], WcfSettings.DEFAULTPORT));
    153152
    154153      ILifecycleManager[] lifecycleManagers =  discService.GetInstances<ILifecycleManager>();
Note: See TracChangeset for help on using the changeset viewer.