diff options
| author | Bob Arnson <bob@firegiant.com> | 2025-02-17 22:30:31 -0500 |
|---|---|---|
| committer | Bob Arnson <github@bobs.org> | 2025-03-03 12:52:51 -0500 |
| commit | ba7fd5837ea149b2e319cc577fad27ce1162a064 (patch) | |
| tree | 5b5940db018333c607147593bb79a547a4836d38 /src/ext/Http/wixext/Symbols | |
| parent | b710f6e40239f12d1b7ff670c8580a550f0bb557 (diff) | |
| download | wix-ba7fd5837ea149b2e319cc577fad27ce1162a064.tar.gz wix-ba7fd5837ea149b2e319cc577fad27ce1162a064.tar.bz2 wix-ba7fd5837ea149b2e319cc577fad27ce1162a064.zip | |
Support non-SNI SSL certificates in Http extension
Implements https://github.com/wixtoolset/issues/issues/7622
Diffstat (limited to 'src/ext/Http/wixext/Symbols')
| -rw-r--r-- | src/ext/Http/wixext/Symbols/CertificateType.cs | 13 | ||||
| -rw-r--r-- | src/ext/Http/wixext/Symbols/HttpCertificateSymbol.cs | 103 | ||||
| -rw-r--r-- | src/ext/Http/wixext/Symbols/HttpSymbolDefinitions.cs | 6 | ||||
| -rw-r--r-- | src/ext/Http/wixext/Symbols/WixHttpSniSslCertSymbol.cs | 95 |
4 files changed, 119 insertions, 98 deletions
diff --git a/src/ext/Http/wixext/Symbols/CertificateType.cs b/src/ext/Http/wixext/Symbols/CertificateType.cs new file mode 100644 index 00000000..1e57ff13 --- /dev/null +++ b/src/ext/Http/wixext/Symbols/CertificateType.cs | |||
| @@ -0,0 +1,13 @@ | |||
| 1 | // Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. | ||
| 2 | |||
| 3 | namespace WixToolset.Http.Symbols | ||
| 4 | { | ||
| 5 | /// <summary> | ||
| 6 | /// Must match constants in httpcerts.cpp | ||
| 7 | /// </summary> | ||
| 8 | public enum CertificateType | ||
| 9 | { | ||
| 10 | SniSsl = 0, | ||
| 11 | IpSsl = 1, | ||
| 12 | } | ||
| 13 | } | ||
diff --git a/src/ext/Http/wixext/Symbols/HttpCertificateSymbol.cs b/src/ext/Http/wixext/Symbols/HttpCertificateSymbol.cs new file mode 100644 index 00000000..1e361b54 --- /dev/null +++ b/src/ext/Http/wixext/Symbols/HttpCertificateSymbol.cs | |||
| @@ -0,0 +1,103 @@ | |||
| 1 | // Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. | ||
| 2 | |||
| 3 | namespace WixToolset.Http | ||
| 4 | { | ||
| 5 | using WixToolset.Data; | ||
| 6 | using WixToolset.Http.Symbols; | ||
| 7 | |||
| 8 | public static partial class HttpSymbolDefinitions | ||
| 9 | { | ||
| 10 | public static readonly IntermediateSymbolDefinition HttpCertificate = new IntermediateSymbolDefinition( | ||
| 11 | HttpSymbolDefinitionType.HttpCertificate.ToString(), | ||
| 12 | new[] | ||
| 13 | { | ||
| 14 | new IntermediateFieldDefinition(nameof(HttpCertificateSymbolFields.Host), IntermediateFieldType.String), | ||
| 15 | new IntermediateFieldDefinition(nameof(HttpCertificateSymbolFields.Port), IntermediateFieldType.String), | ||
| 16 | new IntermediateFieldDefinition(nameof(HttpCertificateSymbolFields.Thumbprint), IntermediateFieldType.String), | ||
| 17 | new IntermediateFieldDefinition(nameof(HttpCertificateSymbolFields.AppId), IntermediateFieldType.String), | ||
| 18 | new IntermediateFieldDefinition(nameof(HttpCertificateSymbolFields.Store), IntermediateFieldType.String), | ||
| 19 | new IntermediateFieldDefinition(nameof(HttpCertificateSymbolFields.HandleExisting), IntermediateFieldType.Number), | ||
| 20 | new IntermediateFieldDefinition(nameof(HttpCertificateSymbolFields.CertificateType), IntermediateFieldType.Number), | ||
| 21 | new IntermediateFieldDefinition(nameof(HttpCertificateSymbolFields.ComponentRef), IntermediateFieldType.String), | ||
| 22 | }, | ||
| 23 | typeof(HttpCertificateSymbol)); | ||
| 24 | } | ||
| 25 | } | ||
| 26 | |||
| 27 | namespace WixToolset.Http.Symbols | ||
| 28 | { | ||
| 29 | using WixToolset.Data; | ||
| 30 | |||
| 31 | public enum HttpCertificateSymbolFields | ||
| 32 | { | ||
| 33 | Host, | ||
| 34 | Port, | ||
| 35 | Thumbprint, | ||
| 36 | AppId, | ||
| 37 | Store, | ||
| 38 | HandleExisting, | ||
| 39 | CertificateType, | ||
| 40 | ComponentRef, | ||
| 41 | } | ||
| 42 | |||
| 43 | public class HttpCertificateSymbol : IntermediateSymbol | ||
| 44 | { | ||
| 45 | public HttpCertificateSymbol() : base(HttpSymbolDefinitions.HttpCertificate, null, null) | ||
| 46 | { | ||
| 47 | } | ||
| 48 | |||
| 49 | public HttpCertificateSymbol(SourceLineNumber sourceLineNumber, Identifier id = null) : base(HttpSymbolDefinitions.HttpCertificate, sourceLineNumber, id) | ||
| 50 | { | ||
| 51 | } | ||
| 52 | |||
| 53 | public IntermediateField this[HttpCertificateSymbolFields index] => this.Fields[(int)index]; | ||
| 54 | |||
| 55 | public string Host | ||
| 56 | { | ||
| 57 | get => this.Fields[(int)HttpCertificateSymbolFields.Host].AsString(); | ||
| 58 | set => this.Set((int)HttpCertificateSymbolFields.Host, value); | ||
| 59 | } | ||
| 60 | |||
| 61 | public string Port | ||
| 62 | { | ||
| 63 | get => this.Fields[(int)HttpCertificateSymbolFields.Port].AsString(); | ||
| 64 | set => this.Set((int)HttpCertificateSymbolFields.Port, value); | ||
| 65 | } | ||
| 66 | |||
| 67 | public string Thumbprint | ||
| 68 | { | ||
| 69 | get => this.Fields[(int)HttpCertificateSymbolFields.Thumbprint].AsString(); | ||
| 70 | set => this.Set((int)HttpCertificateSymbolFields.Thumbprint, value); | ||
| 71 | } | ||
| 72 | |||
| 73 | public string AppId | ||
| 74 | { | ||
| 75 | get => this.Fields[(int)HttpCertificateSymbolFields.AppId].AsString(); | ||
| 76 | set => this.Set((int)HttpCertificateSymbolFields.AppId, value); | ||
| 77 | } | ||
| 78 | |||
| 79 | public string Store | ||
| 80 | { | ||
| 81 | get => this.Fields[(int)HttpCertificateSymbolFields.Store].AsString(); | ||
| 82 | set => this.Set((int)HttpCertificateSymbolFields.Store, value); | ||
| 83 | } | ||
| 84 | |||
| 85 | public HandleExisting HandleExisting | ||
| 86 | { | ||
| 87 | get => (HandleExisting)this.Fields[(int)HttpCertificateSymbolFields.HandleExisting].AsNumber(); | ||
| 88 | set => this.Set((int)HttpCertificateSymbolFields.HandleExisting, (int)value); | ||
| 89 | } | ||
| 90 | |||
| 91 | public CertificateType CertificateType | ||
| 92 | { | ||
| 93 | get => (CertificateType)this.Fields[(int)HttpCertificateSymbolFields.CertificateType].AsNumber(); | ||
| 94 | set => this.Set((int)HttpCertificateSymbolFields.CertificateType, (int)value); | ||
| 95 | } | ||
| 96 | |||
| 97 | public string ComponentRef | ||
| 98 | { | ||
| 99 | get => this.Fields[(int)HttpCertificateSymbolFields.ComponentRef].AsString(); | ||
| 100 | set => this.Set((int)HttpCertificateSymbolFields.ComponentRef, value); | ||
| 101 | } | ||
| 102 | } | ||
| 103 | } | ||
diff --git a/src/ext/Http/wixext/Symbols/HttpSymbolDefinitions.cs b/src/ext/Http/wixext/Symbols/HttpSymbolDefinitions.cs index ff46ce3b..37a7abf0 100644 --- a/src/ext/Http/wixext/Symbols/HttpSymbolDefinitions.cs +++ b/src/ext/Http/wixext/Symbols/HttpSymbolDefinitions.cs | |||
| @@ -7,7 +7,7 @@ namespace WixToolset.Http | |||
| 7 | 7 | ||
| 8 | public enum HttpSymbolDefinitionType | 8 | public enum HttpSymbolDefinitionType |
| 9 | { | 9 | { |
| 10 | WixHttpSniSslCert, | 10 | HttpCertificate, |
| 11 | WixHttpUrlAce, | 11 | WixHttpUrlAce, |
| 12 | WixHttpUrlReservation, | 12 | WixHttpUrlReservation, |
| 13 | } | 13 | } |
| @@ -28,8 +28,8 @@ namespace WixToolset.Http | |||
| 28 | { | 28 | { |
| 29 | switch (type) | 29 | switch (type) |
| 30 | { | 30 | { |
| 31 | case HttpSymbolDefinitionType.WixHttpSniSslCert: | 31 | case HttpSymbolDefinitionType.HttpCertificate: |
| 32 | return HttpSymbolDefinitions.WixHttpSniSslCert; | 32 | return HttpSymbolDefinitions.HttpCertificate; |
| 33 | 33 | ||
| 34 | case HttpSymbolDefinitionType.WixHttpUrlAce: | 34 | case HttpSymbolDefinitionType.WixHttpUrlAce: |
| 35 | return HttpSymbolDefinitions.WixHttpUrlAce; | 35 | return HttpSymbolDefinitions.WixHttpUrlAce; |
diff --git a/src/ext/Http/wixext/Symbols/WixHttpSniSslCertSymbol.cs b/src/ext/Http/wixext/Symbols/WixHttpSniSslCertSymbol.cs deleted file mode 100644 index ec67a089..00000000 --- a/src/ext/Http/wixext/Symbols/WixHttpSniSslCertSymbol.cs +++ /dev/null | |||
| @@ -1,95 +0,0 @@ | |||
| 1 | // Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. | ||
| 2 | |||
| 3 | namespace WixToolset.Http | ||
| 4 | { | ||
| 5 | using WixToolset.Data; | ||
| 6 | using WixToolset.Http.Symbols; | ||
| 7 | |||
| 8 | public static partial class HttpSymbolDefinitions | ||
| 9 | { | ||
| 10 | public static readonly IntermediateSymbolDefinition WixHttpSniSslCert = new IntermediateSymbolDefinition( | ||
| 11 | HttpSymbolDefinitionType.WixHttpSniSslCert.ToString(), | ||
| 12 | new[] | ||
| 13 | { | ||
| 14 | new IntermediateFieldDefinition(nameof(WixHttpSniSslCertSymbolFields.Host), IntermediateFieldType.String), | ||
| 15 | new IntermediateFieldDefinition(nameof(WixHttpSniSslCertSymbolFields.Port), IntermediateFieldType.String), | ||
| 16 | new IntermediateFieldDefinition(nameof(WixHttpSniSslCertSymbolFields.Thumbprint), IntermediateFieldType.String), | ||
| 17 | new IntermediateFieldDefinition(nameof(WixHttpSniSslCertSymbolFields.AppId), IntermediateFieldType.String), | ||
| 18 | new IntermediateFieldDefinition(nameof(WixHttpSniSslCertSymbolFields.Store), IntermediateFieldType.String), | ||
| 19 | new IntermediateFieldDefinition(nameof(WixHttpSniSslCertSymbolFields.HandleExisting), IntermediateFieldType.Number), | ||
| 20 | new IntermediateFieldDefinition(nameof(WixHttpSniSslCertSymbolFields.ComponentRef), IntermediateFieldType.String), | ||
| 21 | }, | ||
| 22 | typeof(WixHttpSniSslCertSymbol)); | ||
| 23 | } | ||
| 24 | } | ||
| 25 | |||
| 26 | namespace WixToolset.Http.Symbols | ||
| 27 | { | ||
| 28 | using WixToolset.Data; | ||
| 29 | |||
| 30 | public enum WixHttpSniSslCertSymbolFields | ||
| 31 | { | ||
| 32 | Host, | ||
| 33 | Port, | ||
| 34 | Thumbprint, | ||
| 35 | AppId, | ||
| 36 | Store, | ||
| 37 | HandleExisting, | ||
| 38 | ComponentRef, | ||
| 39 | } | ||
| 40 | |||
| 41 | public class WixHttpSniSslCertSymbol : IntermediateSymbol | ||
| 42 | { | ||
| 43 | public WixHttpSniSslCertSymbol() : base(HttpSymbolDefinitions.WixHttpSniSslCert, null, null) | ||
| 44 | { | ||
| 45 | } | ||
| 46 | |||
| 47 | public WixHttpSniSslCertSymbol(SourceLineNumber sourceLineNumber, Identifier id = null) : base(HttpSymbolDefinitions.WixHttpSniSslCert, sourceLineNumber, id) | ||
| 48 | { | ||
| 49 | } | ||
| 50 | |||
| 51 | public IntermediateField this[WixHttpSniSslCertSymbolFields index] => this.Fields[(int)index]; | ||
| 52 | |||
| 53 | public string Host | ||
| 54 | { | ||
| 55 | get => this.Fields[(int)WixHttpSniSslCertSymbolFields.Host].AsString(); | ||
| 56 | set => this.Set((int)WixHttpSniSslCertSymbolFields.Host, value); | ||
| 57 | } | ||
| 58 | |||
| 59 | public string Port | ||
| 60 | { | ||
| 61 | get => this.Fields[(int)WixHttpSniSslCertSymbolFields.Port].AsString(); | ||
| 62 | set => this.Set((int)WixHttpSniSslCertSymbolFields.Port, value); | ||
| 63 | } | ||
| 64 | |||
| 65 | public string Thumbprint | ||
| 66 | { | ||
| 67 | get => this.Fields[(int)WixHttpSniSslCertSymbolFields.Thumbprint].AsString(); | ||
| 68 | set => this.Set((int)WixHttpSniSslCertSymbolFields.Thumbprint, value); | ||
| 69 | } | ||
| 70 | |||
| 71 | public string AppId | ||
| 72 | { | ||
| 73 | get => this.Fields[(int)WixHttpSniSslCertSymbolFields.AppId].AsString(); | ||
| 74 | set => this.Set((int)WixHttpSniSslCertSymbolFields.AppId, value); | ||
| 75 | } | ||
| 76 | |||
| 77 | public string Store | ||
| 78 | { | ||
| 79 | get => this.Fields[(int)WixHttpSniSslCertSymbolFields.Store].AsString(); | ||
| 80 | set => this.Set((int)WixHttpSniSslCertSymbolFields.Store, value); | ||
| 81 | } | ||
| 82 | |||
| 83 | public HandleExisting HandleExisting | ||
| 84 | { | ||
| 85 | get => (HandleExisting)this.Fields[(int)WixHttpSniSslCertSymbolFields.HandleExisting].AsNumber(); | ||
| 86 | set => this.Set((int)WixHttpSniSslCertSymbolFields.HandleExisting, (int)value); | ||
| 87 | } | ||
| 88 | |||
| 89 | public string ComponentRef | ||
| 90 | { | ||
| 91 | get => this.Fields[(int)WixHttpSniSslCertSymbolFields.ComponentRef].AsString(); | ||
| 92 | set => this.Set((int)WixHttpSniSslCertSymbolFields.ComponentRef, value); | ||
| 93 | } | ||
| 94 | } | ||
| 95 | } | ||
