Skip to content

Commit

Permalink
Error check site by id.
Browse files Browse the repository at this point in the history
  • Loading branch information
Bryan-Legend committed Nov 13, 2015
1 parent 37a1924 commit 0656bc6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
6 changes: 1 addition & 5 deletions letsencrypt-win-simple/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,7 @@ static string GetIssuerCertificate(CertificateRequest certificate)
</system.webServer>
</configuration>";

// all this would do is move the handler to the bottom, which is the last place you want it.
//<handlers>
// <remove name = "StaticFile" />
// < add name="StaticFile" path="*." verb="*" type="" modules="StaticFileModule,DefaultDocumentModule,DirectoryListingModule" scriptProcessor="" resourceType="Either" requireAccess="Read" allowPathInfo="false" preCondition="" responseBufferLimit="4194304" />
Expand Down Expand Up @@ -414,14 +415,9 @@ static AuthorizationState Authorize(string dnsIdentifier, string webRootPath)
try
{
Console.WriteLine(" Submitting answer");
// This always throws throw new InvalidOperationException("challenge answer has not been generated"); because the authoState.Challenge list isn't changing for some reason

authzState.Challenges = new AuthorizeChallenge[] { challenge };
client.SubmitAuthorizeChallengeAnswer(authzState, AcmeProtocol.CHALLENGE_TYPE_HTTP, true);

// so I pulled the core of SubmitAuthorizeChallengeAnswer into it's own method that I can call directly
//client.SubmitAuthorizeChallengeAnswer(challenge, true);

// have to loop to wait for server to stop being pending.
// TODO: put timeout/retry limit in this loop
while (authzState.Status == "pending")
Expand Down
7 changes: 6 additions & 1 deletion letsencrypt-win-simple/SiteHost.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@ public class TargetBinding

public Site GetSite(ServerManager iisManager)
{
return iisManager.Sites[(int)SiteId];
foreach (var site in iisManager.Sites)
{
if (site.Id == SiteId)
return site;
}
throw new System.Exception($"Unable to find IIS site ID #{SiteId} for binding {this}");
}

public string GetPhysicalPath(ServerManager iisManager)
Expand Down

0 comments on commit 0656bc6

Please sign in to comment.