Skip to content

Commit

Permalink
Fixed GetCertificates error
Browse files Browse the repository at this point in the history
  • Loading branch information
shibayan committed Sep 26, 2018
1 parent 03fb2ff commit 70d00c9
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions AzureKeyVault.LetsEncrypt/SharedFunctions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ public static class SharedFunctions
{
private static readonly HttpClient _httpClient = new HttpClient();
private static readonly HttpClient _acmeHttpClient = new HttpClient { BaseAddress = new Uri("https://acme-v02.api.letsencrypt.org/") };
//private static readonly HttpClient _acmeHttpClient = new HttpClient { BaseAddress = new Uri("https://acme-staging-v02.api.letsencrypt.org/") };

[FunctionName(nameof(IssueCertificate))]
public static async Task IssueCertificate([OrchestrationTrigger] DurableOrchestrationContext context, ILogger log)
Expand Down Expand Up @@ -64,7 +63,7 @@ public static async Task<IList<CertificateBundle>> GetCertificates([ActivityTrig

var certificates = await keyVaultClient.GetCertificatesAsync(Settings.Default.VaultBaseUrl);

var list = certificates.Where(x => x.Tags.TryGetValue("Issuer", out var issuer) && issuer == "letsencrypt.org")
var list = certificates.Where(x => x.Tags != null && x.Tags.TryGetValue("Issuer", out var issuer) && issuer == "letsencrypt.org")
.Where(x => (x.Attributes.Expires.Value - currentDateTime).TotalDays < 30)
.ToArray();

Expand Down

0 comments on commit 70d00c9

Please sign in to comment.