Parcourir la source

Merge remote-tracking branch 'origin/master'

release/3.x.x
Christian Kratky il y a 4 ans
Parent
révision
e8a683b936
9 fichiers modifiés avec 42 ajouts et 4 suppressions
  1. +9
    -0
      Build/MQTTnet.nuspec
  2. +1
    -0
      Build/build.ps1
  3. +1
    -0
      Source/MQTTnet.AspnetCore/MQTTnet.AspNetCore.csproj
  4. +3
    -1
      Source/MQTTnet/Client/Options/MqttClientOptionsBuilder.cs
  5. +5
    -1
      Source/MQTTnet/Client/Options/MqttClientOptionsBuilderTlsParameters.cs
  6. +4
    -0
      Source/MQTTnet/Client/Options/MqttClientTlsOptions.cs
  7. +2
    -0
      Source/MQTTnet/Diagnostics/TargetFrameworkProvider.cs
  8. +16
    -1
      Source/MQTTnet/Implementations/MqttTcpChannel.cs
  9. +1
    -1
      Source/MQTTnet/MQTTnet.csproj

+ 9
- 0
Build/MQTTnet.nuspec Voir le fichier

@@ -37,6 +37,12 @@
<dependency id="System.Net.WebSockets" version="4.3.0" />
<dependency id="System.Net.WebSockets.Client" version="4.3.2" />
</group>
<group targetFramework="netcoreapp3.1">
<dependency id="NETStandard.Library" version="2.0.0" />
<dependency id="System.Net.Security" version="4.3.2" />
<dependency id="System.Net.WebSockets" version="4.3.0" />
<dependency id="System.Net.WebSockets.Client" version="4.3.2" />
</group>
<group targetFramework="uap10.0">
<dependency id="Microsoft.NETCore.UniversalWindowsPlatform" version="6.2.10" />
</group>
@@ -59,6 +65,9 @@
<!-- .NET Standard 2.1 -->
<file src="..\Source\MQTTnet\bin\Release\netstandard2.1\MQTTnet.*" target="lib\netstandard2.1\"/>

<!-- .NET Standard 3.1 -->
<file src="..\Source\MQTTnet\bin\Release\netcoreapp3.1\MQTTnet.*" target="lib\netcoreapp3.1\"/>

<!-- Universal Windows -->
<file src="..\Source\MQTTnet\bin\Release\uap10.0\MQTTnet.*" target="lib\uap10.0\"/>



+ 1
- 0
Build/build.ps1 Voir le fichier

@@ -29,6 +29,7 @@ vstest.console.exe ..\Tests\MQTTnet.AspNetCore.Tests\bin\Release\netcoreapp3.1\M
&$msbuild ..\Source\MQTTnet\MQTTnet.csproj /t:Build /p:Configuration="Release" /p:TargetFramework="netstandard1.3" /p:FileVersion=$assemblyVersion /p:AssemblyVersion=$assemblyVersion /verbosity:m /p:SignAssembly=true /p:AssemblyOriginatorKeyFile=".\..\..\Build\codeSigningKey.pfx"
&$msbuild ..\Source\MQTTnet\MQTTnet.csproj /t:Build /p:Configuration="Release" /p:TargetFramework="netstandard2.0" /p:FileVersion=$assemblyVersion /p:AssemblyVersion=$assemblyVersion /verbosity:m /p:SignAssembly=true /p:AssemblyOriginatorKeyFile=".\..\..\Build\codeSigningKey.pfx"
&$msbuild ..\Source\MQTTnet\MQTTnet.csproj /t:Build /p:Configuration="Release" /p:TargetFramework="netstandard2.1" /p:FileVersion=$assemblyVersion /p:AssemblyVersion=$assemblyVersion /verbosity:m /p:SignAssembly=true /p:AssemblyOriginatorKeyFile=".\..\..\Build\codeSigningKey.pfx"
&$msbuild ..\Source\MQTTnet\MQTTnet.csproj /t:Build /p:Configuration="Release" /p:TargetFramework="netcoreapp3.1" /p:FileVersion=$assemblyVersion /p:AssemblyVersion=$assemblyVersion /verbosity:m /p:SignAssembly=true /p:AssemblyOriginatorKeyFile=".\..\..\Build\codeSigningKey.pfx"
&$msbuild ..\Source\MQTTnet\MQTTnet.csproj /t:Build /p:Configuration="Release" /p:TargetFramework="uap10.0" /p:FileVersion=$assemblyVersion /p:AssemblyVersion=$assemblyVersion /verbosity:m /p:SignAssembly=true /p:AssemblyOriginatorKeyFile=".\..\..\Build\codeSigningKey.pfx"

# Build the ASP.NET Core 2.0 extension


+ 1
- 0
Source/MQTTnet.AspnetCore/MQTTnet.AspNetCore.csproj Voir le fichier

@@ -27,6 +27,7 @@
<ItemGroup Condition="'$(TargetFramework)' != 'netcoreapp3.1'">
<PackageReference Include="Microsoft.AspNetCore.Http.Connections" Version="1.1.0" />
<PackageReference Include="System.IO.Pipelines" Version="4.7.2" />
</ItemGroup>

<ItemGroup>


+ 3
- 1
Source/MQTTnet/Client/Options/MqttClientOptionsBuilder.cs Voir le fichier

@@ -280,7 +280,9 @@ namespace MQTTnet.Client.Options
#pragma warning disable CS0618 // Type or member is obsolete
CertificateValidationCallback = _tlsParameters.CertificateValidationCallback,
#pragma warning restore CS0618 // Type or member is obsolete

#if NETCOREAPP3_1
ApplicationProtocols = _tlsParameters.ApplicationProtocols,
#endif
CertificateValidationHandler = _tlsParameters.CertificateValidationHandler,
IgnoreCertificateChainErrors = _tlsParameters.IgnoreCertificateChainErrors,
IgnoreCertificateRevocationErrors = _tlsParameters.IgnoreCertificateRevocationErrors


+ 5
- 1
Source/MQTTnet/Client/Options/MqttClientOptionsBuilderTlsParameters.cs Voir le fichier

@@ -27,7 +27,11 @@ namespace MQTTnet.Client.Options
public IEnumerable<X509Certificate> Certificates { get; set; }
#endif

public bool AllowUntrustedCertificates { get; set; }
#if NETCOREAPP3_1
public List<SslApplicationProtocol> ApplicationProtocols { get;set; }
#endif

public bool AllowUntrustedCertificates { get; set; }

public bool IgnoreCertificateChainErrors { get; set; }



+ 4
- 0
Source/MQTTnet/Client/Options/MqttClientTlsOptions.cs Voir le fichier

@@ -22,6 +22,10 @@ namespace MQTTnet.Client.Options
public List<X509Certificate> Certificates { get; set; }
#endif

#if NETCOREAPP3_1
public List<SslApplicationProtocol> ApplicationProtocols {get;set;}
#endif

public SslProtocols SslProtocol { get; set; } = SslProtocols.Tls12;

[Obsolete("This property will be removed soon. Use CertificateValidationHandler instead.")]


+ 2
- 0
Source/MQTTnet/Diagnostics/TargetFrameworkProvider.cs Voir le fichier

@@ -20,6 +20,8 @@
return "netstandard2.1";
#elif WINDOWS_UWP
return "uap10.0";
#elif NETCOREAPP3_1
return "netcoreapp3.1";
#endif
}
}


+ 16
- 1
Source/MQTTnet/Implementations/MqttTcpChannel.cs Voir le fichier

@@ -81,7 +81,22 @@ namespace MQTTnet.Implementations
var sslStream = new SslStream(networkStream, false, InternalUserCertificateValidationCallback);
try
{
await sslStream.AuthenticateAsClientAsync(_options.Server, LoadCertificates(), _options.TlsOptions.SslProtocol, !_options.TlsOptions.IgnoreCertificateRevocationErrors).ConfigureAwait(false);
#if NETCOREAPP3_1
var sslOptions = new SslClientAuthenticationOptions
{
ApplicationProtocols = _options.TlsOptions.ApplicationProtocols,
ClientCertificates = LoadCertificates(),
EnabledSslProtocols = _options.TlsOptions.SslProtocol,
CertificateRevocationCheckMode = _options.TlsOptions.IgnoreCertificateRevocationErrors ? X509RevocationMode.Online : X509RevocationMode.NoCheck,
TargetHost = _options.Server
};
await sslStream.AuthenticateAsClientAsync(sslOptions, cancellationToken).ConfigureAwait(false);
#else
await sslStream.AuthenticateAsClientAsync(_options.Server, LoadCertificates(), _options.TlsOptions.SslProtocol, !_options.TlsOptions.IgnoreCertificateRevocationErrors).ConfigureAwait(false);
#endif
}
catch
{


+ 1
- 1
Source/MQTTnet/MQTTnet.csproj Voir le fichier

@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netstandard1.3;netstandard2.0;netstandard2.1</TargetFrameworks>
<TargetFrameworks>netstandard1.3;netstandard2.0;netstandard2.1;netcoreapp3.1</TargetFrameworks>
<TargetFrameworks Condition=" '$(OS)' == 'Windows_NT' ">$(TargetFrameworks);net452;net461</TargetFrameworks>
<TargetFrameworks Condition=" '$(OS)' == 'Windows_NT' AND '$(MSBuildRuntimeType)' != 'Core' AND '$(SolutionName)' != 'MQTTnet.noUWP' ">$(TargetFrameworks);uap10.0</TargetFrameworks>
<AssemblyName>MQTTnet</AssemblyName>


Chargement…
Annuler
Enregistrer