Skip to content

Commit

Permalink
Fix for checking challenge files that are served using staging ssl ce…
Browse files Browse the repository at this point in the history
…rtificates, if redirect to https has been enabled for the acme-challenge directory.
  • Loading branch information
sjkp committed Mar 23, 2016
1 parent a98dff1 commit ecb7f70
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 13 deletions.
24 changes: 15 additions & 9 deletions LetsEncrypt.SiteExtension.Core/CertificateManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -534,16 +534,22 @@ public static AuthorizationState Authorize(Target target)
var retry = 10;
while (true)
{
using (var client = new HttpClient())
using (var handler = new WebRequestHandler())
{
Thread.Sleep(1000);
var x = client.GetAsync(answerUri).Result;
Trace.TraceInformation("Checking status {0}", x.StatusCode);
if (x.StatusCode == HttpStatusCode.OK)
break;
if (retry-- == 0)
break;
Trace.TraceInformation("Retrying {0}", retry);
//Allow self-signed certs otherwise staging wont work
handler.ServerCertificateValidationCallback = (sender, cert, chain, sslPolicyErrors) => true;

using (var client = new HttpClient(handler))
{
Thread.Sleep(1000);
var x = client.GetAsync(answerUri).Result;
Trace.TraceInformation("Checking status {0}", x.StatusCode);
if (x.StatusCode == HttpStatusCode.OK)
break;
if (retry-- == 0)
break;
Trace.TraceInformation("Retrying {0}", retry);
}
}
}
Console.WriteLine(" Submitting answer");
Expand Down
2 changes: 1 addition & 1 deletion LetsEncrypt.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<metadata>
<id>letsencrypt</id>
<title>Azure Let's Encrypt (x86)</title>
<version>0.4.10</version>
<version>0.4.11</version>
<authors>SJKP</authors>
<licenseUrl>http://opensource.org/licenses/Apache-2.0</licenseUrl>
<projectUrl>https://github.com/sjkp/letsencrypt-siteextension</projectUrl>
Expand Down
2 changes: 1 addition & 1 deletion LetsEncrypt64.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<metadata>
<id>letsencrypt64</id>
<title>Azure Let's Encrypt (x64)</title>
<version>0.4.10</version>
<version>0.4.11</version>
<authors>SJKP</authors>
<licenseUrl>http://opensource.org/licenses/Apache-2.0</licenseUrl>
<projectUrl>https://github.com/sjkp/letsencrypt-siteextension</projectUrl>
Expand Down
2 changes: 1 addition & 1 deletion letsencrypt.siteextension.job.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<metadata>
<id>letsencrypt.siteextension.job</id>
<title>Azure SiteExtension Let's Encrypt WebJob</title>
<version>0.4.10-beta</version>
<version>0.4.11-beta</version>
<authors>SJKP</authors>
<licenseUrl>http://opensource.org/licenses/Apache-2.0</licenseUrl>
<projectUrl>https://github.com/sjkp/letsencrypt-siteextension</projectUrl>
Expand Down
2 changes: 1 addition & 1 deletion letsencrypt.siteextension.job64.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<metadata>
<id>letsencrypt.siteextension.job64</id>
<title>Azure SiteExtension Let's Encrypt WebJob (64bit)</title>
<version>0.4.10-beta</version>
<version>0.4.11-beta</version>
<authors>SJKP</authors>
<licenseUrl>http://opensource.org/licenses/Apache-2.0</licenseUrl>
<projectUrl>https://github.com/sjkp/letsencrypt-siteextension</projectUrl>
Expand Down

0 comments on commit ecb7f70

Please sign in to comment.