Last change
on this file since 3051 was
3006,
checked in by gkronber, 15 years ago
|
Implemented deployment service on servdev.heuristiclab.com and changed all service references and configurations to point to the service address. Improved GUI of installation manager. Implemented user name authentication and authorization for the deployment service. #860 (Deployment server for plugin installation from web locations)
|
File size:
1.4 KB
|
Line | |
---|
1 | using System;
|
---|
2 | using System.Collections.Generic;
|
---|
3 | using System.Linq;
|
---|
4 | using System.Text;
|
---|
5 | using System.ServiceModel;
|
---|
6 | using System.Security.Cryptography.X509Certificates;
|
---|
7 | using System.Reflection;
|
---|
8 |
|
---|
9 | namespace HeuristicLab.PluginInfrastructure.Advanced.DeploymentService {
|
---|
10 | public static class UpdateClientFactory {
|
---|
11 | private static byte[] serverCrtData;
|
---|
12 |
|
---|
13 | static UpdateClientFactory() {
|
---|
14 | var stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("HeuristicLab.PluginInfrastructure.Advanced.DeploymentService.servdev.cer");
|
---|
15 | serverCrtData = new byte[stream.Length];
|
---|
16 | stream.Read(serverCrtData, 0, serverCrtData.Length);
|
---|
17 | }
|
---|
18 |
|
---|
19 | public static UpdateClient CreateClient() {
|
---|
20 | var client = new UpdateClient();
|
---|
21 | client.ClientCredentials.UserName.UserName = HeuristicLab.PluginInfrastructure.Properties.Settings.Default.UpdateLocationUserName;
|
---|
22 | client.ClientCredentials.UserName.Password = HeuristicLab.PluginInfrastructure.Properties.Settings.Default.UpdateLocationPassword;
|
---|
23 | client.Endpoint.Address = new EndpointAddress(HeuristicLab.PluginInfrastructure.Properties.Settings.Default.UpdateLocation);
|
---|
24 | client.ClientCredentials.ServiceCertificate.DefaultCertificate = new X509Certificate2(serverCrtData);
|
---|
25 | client.ClientCredentials.ServiceCertificate.Authentication.CertificateValidationMode = System.ServiceModel.Security.X509CertificateValidationMode.None;
|
---|
26 | return client;
|
---|
27 | }
|
---|
28 | }
|
---|
29 | }
|
---|
Note: See
TracBrowser
for help on using the repository browser.