MTConnect.NET-TLS
7.2.0.105
dotnet add package MTConnect.NET-TLS --version 7.2.0.105
NuGet\Install-Package MTConnect.NET-TLS -Version 7.2.0.105
<PackageReference Include="MTConnect.NET-TLS" Version="7.2.0.105" />
<PackageVersion Include="MTConnect.NET-TLS" Version="7.2.0.105" />
<PackageReference Include="MTConnect.NET-TLS" />
paket add MTConnect.NET-TLS --version 7.2.0.105
#r "nuget: MTConnect.NET-TLS, 7.2.0.105"
#:package MTConnect.NET-TLS@7.2.0.105
#addin nuget:?package=MTConnect.NET-TLS&version=7.2.0.105
#tool nuget:?package=MTConnect.NET-TLS&version=7.2.0.105

MTConnect.NET-TLS
MTConnect.NET-TLS is an extension library to MTConnect.NET that provides TLS certificate loading and configuration for use with the HTTP and MQTT transport layers.
For TLS configuration within the HTTP server module or the MQTT relay module, see Modules.
Overview
This library defines the TlsConfiguration class and its companion types (PfxCertificateConfiguration, PemCertificateConfiguration, CertificateLoadResult) that are consumed by the HTTP server (MTConnectHttpServer), the MQTT client (MTConnectMqttClient), and the MQTT relay/broker Agent modules to set up TLS-secured connections. Both PFX (PKCS#12) and PEM certificate formats are supported.
Loading a PEM certificate requires .NET 5 or later. On .NET Framework and .NET Standard 2.0, a
pemconfiguration does not load a certificate (an error result is returned), so usepfxon those frameworks.
The TlsConfiguration.GetCertificate() method loads the certificate from the configured source and returns a CertificateLoadResult:
- When the certificate was loaded,
SuccessistrueandCertificatecontains the loadedX509Certificate2. - When loading failed,
SuccessisfalseandExceptioncontains the exception that prevented loading. - When no certificate is configured (neither
pfxnorpemis set, or thecertificatePathis empty),Successisfalseand bothCertificateandExceptionare null.
The TlsConfiguration.GetCertificateAuthority() method loads the certificate set in pem.certificateAuthority and returns a CertificateLoadResult in the same way.
Configuration
PFX Certificate
tls:
pfx:
certificatePath: c:\certs\mtconnect-testing.pfx
certificatePassword: mtconnect
PEM Certificate (with Certificate Authority)
tls:
pem:
certificateAuthority: c:\certs\rootCA.crt
certificatePath: c:\certs\mtconnect-testing.crt
privateKeyPath: c:\certs\mtconnect-testing.key
privateKeyPassword: mtconnect
Configuration Properties
pfx- PFX (PKCS#12) certificate settings. Takes precedence overpemwhen both are provided.certificatePath- Path to the.pfxfile containing the certificate and its private key.certificatePassword- Password protecting the PFX file (omit if the file is not password-protected).
pem- PEM certificate settings, used whenpfxis not configured.certificateAuthority- Path to the.pemor.crtfile containing the trusted CA certificate. Only read by the MQTT client and the MQTT relay module.certificatePath- Path to the.pemor.crtfile containing the server or client certificate.privateKeyPath- Path to the.keyfile containing the private key.privateKeyPassword- Password protecting the private key (omit if the key is unencrypted).
verifyClientCertificate- Only read by the MQTT client (MTConnectMqttClient) and the MQTT relay module. Whentrue, an untrusted certificate presented by the MQTT broker is rejected. Whenfalse(the default), untrusted certificates are allowed. It is not read by the HTTP server or the MQTT broker module, so it does not make a server require a client certificate.omitCAValidation- Only read by the MQTT client (MTConnectMqttClient) and the MQTT relay module. Whentrue, thecertificateAuthoritycertificate is not added to the list of client certificates that is sent to the MQTT broker. On .NET 5 or later, the certificate presented by the broker is still validated against thecertificateAuthoritycertificate when one is configured.
Generating a Self-Signed Certificate (PowerShell)
New-SelfSignedCertificate -DnsName "localhost" -CertStoreLocation "cert:\LocalMachine\My" -FriendlyName "MTConnect-Test" -Type "SSLServerAuthentication" -NotAfter (Get-Date).AddYears(1)
Related Libraries
- MTConnect.NET-HTTP — HTTP client and server transport
- MTConnect.NET-MQTT — MQTT client transport
Contribution / Feedback
- Please use the Issues tab to create issues for specific problems that you may encounter
- Please feel free to use the Pull Requests tab for any suggested improvements to the source code
- For any other questions or feedback, please contact TrakHound directly at info@trakhound.com.
License
This library and its source code is licensed under the MIT License and is free to use and distribute.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 is compatible. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 is compatible. net462 is compatible. net463 was computed. net47 is compatible. net471 is compatible. net472 is compatible. net48 is compatible. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETFramework 4.6.1
- MTConnect.NET-Common (>= 7.2.0.105)
-
.NETFramework 4.6.2
- MTConnect.NET-Common (>= 7.2.0.105)
-
.NETFramework 4.7
- MTConnect.NET-Common (>= 7.2.0.105)
-
.NETFramework 4.7.1
- MTConnect.NET-Common (>= 7.2.0.105)
-
.NETFramework 4.7.2
- MTConnect.NET-Common (>= 7.2.0.105)
-
.NETFramework 4.8
- MTConnect.NET-Common (>= 7.2.0.105)
-
.NETStandard 2.0
- MTConnect.NET-Common (>= 7.2.0.105)
-
net10.0
- MTConnect.NET-Common (>= 7.2.0.105)
-
net6.0
- MTConnect.NET-Common (>= 7.2.0.105)
-
net7.0
- MTConnect.NET-Common (>= 7.2.0.105)
-
net8.0
- MTConnect.NET-Common (>= 7.2.0.105)
-
net9.0
- MTConnect.NET-Common (>= 7.2.0.105)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on MTConnect.NET-TLS:
| Package | Downloads |
|---|---|
|
MTConnect.NET-HTTP
MTConnect.NET-HTTP implements the HTTP protocol for use with the MTConnect.NET library. Supports MTConnect versions up to 2.7. Supports .NET Framework 4.6.1 up to .NET 10 |
|
|
MTConnect.NET-MQTT
MTConnect.NET-MQTT implements the MQTT Protocol for use with the MTConnect.NET library. Supports MTConnect versions up to 2.7. Supports .NET Framework 4.6.1 up to .NET 10 |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 7.2.0.105 | 0 | 11/21/2026 |
| 7.2.0.105-prerelease | 0 | 11/21/2026 |
| 7.2.0.103-prerelease | 73 | 11/20/2026 |
| 7.0.0.2-prerelease | 394 | 6/26/2026 |
| 6.9.0.2 | 7,780 | 10/16/2025 |
| 6.8.0 | 1,103 | 9/13/2025 |
| 6.7.0 | 3,050 | 6/22/2025 |
| 6.6.0 | 4,027 | 1/18/2025 |
| 6.5.1 | 1,432 | 12/3/2024 |
| 6.5.0 | 3,244 | 10/21/2024 |
| 6.4.7 | 1,540 | 8/21/2024 |
| 6.4.6 | 1,230 | 8/7/2024 |
| 6.4.5 | 770 | 8/2/2024 |
| 6.4.4 | 1,046 | 7/16/2024 |
| 6.4.3 | 1,089 | 6/14/2024 |
| 6.4.2 | 910 | 6/12/2024 |
| 6.4.1 | 1,250 | 5/17/2024 |
| 6.4.0 | 838 | 5/14/2024 |
| 6.3.2-beta | 739 | 5/2/2024 |
| 6.3.1-beta | 25,473 | 4/24/2024 |