Skip to content

Commit 830a9aa

Browse files
committed
chore: coderabbit nits
1 parent 8f6c434 commit 830a9aa

2 files changed

Lines changed: 8 additions & 7 deletions

File tree

src/CommonLib/Ntlm/HttpNtlmAuthenticationService.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public class HttpNtlmAuthenticationService {
2222

2323
public HttpNtlmAuthenticationService(INtlmHttpClientFactory ntlmHttpClientFactory, ILogger logger = null) {
2424
_logger = logger ?? Logging.LogProvider.CreateLogger(nameof(HttpNtlmAuthenticationService));
25-
_ntlmHttpClientFactory = ntlmHttpClientFactory;
25+
_ntlmHttpClientFactory = ntlmHttpClientFactory ?? throw new ArgumentNullException(nameof(ntlmHttpClientFactory));
2626
_getSupportedNTLMAuthSchemesAdaptiveTimeout = new AdaptiveTimeout(maxTimeout: TimeSpan.FromMinutes(2), Logging.LogProvider.CreateLogger(nameof(GetSupportedNtlmAuthSchemesAsync)));
2727
_ntlmAuthAdaptiveTimeout = new AdaptiveTimeout(maxTimeout: TimeSpan.FromMinutes(2), Logging.LogProvider.CreateLogger(nameof(NtlmAuthenticationHandler.PerformNtlmAuthenticationAsync)));
2828
_authWithChannelBindingAdaptiveTimeout = new AdaptiveTimeout(maxTimeout: TimeSpan.FromMinutes(2), Logging.LogProvider.CreateLogger(nameof(AuthWithBadChannelBindingsAsync)));
@@ -206,4 +206,4 @@ public AuthNotRequiredException() {
206206

207207
public AuthNotRequiredException(string message) : base(message) {
208208
}
209-
}
209+
}

src/CommonLib/Processors/CAEnrollmentProcessor.cs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,9 @@ public class CAEnrollmentProcessor {
1919
private readonly string _caName;
2020
private readonly ILogger _logger;
2121

22-
private const SslProtocols CaEnrollmentSslProtocols =
23-
SslProtocols.Ssl3 | SslProtocols.Tls | SslProtocols.Tls11 | SslProtocols.Tls12;
22+
// TLS1.3 is not available in .Net Framework 4.7.2, but the enum can still be assigned.
23+
private const SslProtocols CaEnrollmentSslProtocols =
24+
SslProtocols.Ssl3 | SslProtocols.Tls | SslProtocols.Tls11 | SslProtocols.Tls12 | (SslProtocols)12288;
2425

2526
public CAEnrollmentProcessor(string caDnsHostname, string caName, ILogger log = null) {
2627
_caDnsHostname = caDnsHostname;
@@ -46,7 +47,7 @@ await Task.WhenAll(
4647
} catch (Exception ex) {
4748
_logger.LogError(ex, "An error occurred while scanning enrollment endpoints");
4849
}
49-
50+
5051
endpoints = TagEndpoints(endpoints).ToList();
5152

5253
return endpoints;
@@ -57,7 +58,7 @@ private IEnumerable<APIResult<CAEnrollmentEndpoint>> TagEndpoints(IEnumerable<AP
5758
foreach (var endpoint in tagEndpoints) {
5859
if (!endpoint.Collected)
5960
continue;
60-
61+
6162
var enrollmentEndpoint = endpoint.Result;
6263
if (enrollmentEndpoint.Url.Scheme != Uri.UriSchemeHttps) {
6364
switch (enrollmentEndpoint.Status) {
@@ -226,4 +227,4 @@ private async Task<APIResult<CAEnrollmentEndpoint>> GetNtlmEndpoint(Uri url, boo
226227
}
227228
}
228229
}
229-
}
230+
}

0 commit comments

Comments
 (0)