mirror of
https://github.com/ridercz/AutoACME.git
synced 2026-04-25 15:15:53 +03:00
[GH-ISSUE #26] Remote Server Returned 404 Error Question #24
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/AutoACME#24
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Tessando on GitHub (Jun 18, 2018).
Original GitHub issue: https://github.com/ridercz/AutoACME/issues/26
I am attempting to use AutoACME to get a certificate for a site (http://scratchpaste.com).
I have configured AutoACME using LE Production (for my first attempt) and LE Stage Server(s) for my second attempt.
Both attempts failed at the same step. Can you please look at the request below to see if there are any clues or any obvious steps I missed in configuring this?
Thanks!
`C:\CertStore\AutoACME>autoacme addhost scratchpaste.com
Altairis AutoACME Manager version 1.5.4.0
Copyright (c) Michal A. Valasek - Altairis, 2017
www.autoacme.net | www.rider.cz | www.altairis.cz
Reading configuration from 'C:\CertStore\AutoACME\autoacme.json'...OK
Checking host...OK
Requesting cerificate for scratchpaste.com:
Accepting TOS at https://letsencrypt.org/documents/LE-SA-v1.2-November-15-2017.pdf...OK
Testing authorization:
Writing challenge to C:\InetPub\wwwroot\AutoAcme\probe_6bc19e56-3f36-4183-ba33-c7e5693d6123...OK
Testing HTTP challenge:
Preparing request to http://scratchpaste.com/.well-known/acme-challenge/probe_6bc19e56-3f36-4183-ba33-c7e5693d6123...OK
Getting response...Failed!
The remote server returned an error: (404) Not Found.
Testing HTTPS challenge:
Preparing request to https://scratchpaste.com/.well-known/acme-challenge/probe_6bc19e56-3f36-4183-ba33-c7e5693d6123...OK
Getting response...Failed!
The underlying connection was closed: An unexpected error occurred on a send.
Deleting challenge from C:\InetPub\wwwroot\AutoAcme\probe_6bc19e56-3f36-4183-ba33-c7e5693d6123...OK
Request failed: One or more errors occurred.
Failed!
Unable to get certificate for new host.
C:\CertStore\AutoACME>`
@Tessando commented on GitHub (Jun 25, 2018):
When I setup the Centralized Certificate Settings in IIS, I used the local system's Administrator login and the password. I have verified that this user can gain access to the location where AutoACME is putting the challenge, but for some reason it cannot access it.
I thought this would be permissions based or perhaps networking, but the site comes up both inside a browser on the local machine and outside of the server on my local machine.
Is there anything you can think of that I missed? Why would I be getting that 404 error?
Thank you for your help.
@ridercz commented on GitHub (Jun 25, 2018):
Most likely your URL rewriting is configured incorrectly. Try creating file
C:\InetPub\wwwroot\AutoAcme\test.txt. It should be reachable ashttp://scratchpaster.com/.well-known/acme-challenge/test.txt. If it is not, your routing is setup incorrectly.@Tessando commented on GitHub (Jun 25, 2018):
Thank you, I will test this soon. :)
@Tessando commented on GitHub (Jun 27, 2018):
Thank you, Michal -
I was able to fix this up by moving the "AutoACME" folder to the root of the scratchpaste_com website. This allowed localhost to resolve and the test TEXT file:
http://scratchpaste.com/.well-known/acme-challenge/test.txt
Here's the error that I'm still getting... hopefully this will provide a little more insight:
Thanks for your help.
@ridercz commented on GitHub (Jun 27, 2018):
The cause is still the same: you have almost certainly invalid setup of the URL rewriting mechanism. You have to rewrite all requests to
http://any-site-on-your-server/.well-known/acme-challenge/*tohttp://localhost/AutoACME/*(if you are following the howto document).@Tessando commented on GitHub (Jun 29, 2018):
Thanks Michal -
Here's a screenshot of how my URL reWriter is setup. Is there anything obvious here that I need to change?
https://futurebohemian.com/github/url-re-writer.png
Thanks!
@ridercz commented on GitHub (Aug 15, 2018):
I don't see anything wrong on your screenshot. But according to your previous messages, you have some really weird configuration, not according to the howto document.
You need TWO working web sites:
First, internal web site where
http://localhost/AutoAcme/*points toC:\InetPub\wwwroot\AutoACME. So if you'll createC:\InetPub\wwwroot\AutoACME\test.txt, it'll be reachable ashttp://localhost/AutoAcme/test.txt.Second, there is the websites you want to protect. They need the rewrite rule, that rewrites
http://*/.well-known/acme-challenge/*tohttp://localhost/AutoAcme/*.From your messages it seems that you have a single web site and you're trying to get it to rewrite to itself and it's not how it's supposed to work.
If you know what you're doing, you can of course change the urls - use something else instead of localhost and default web site. But then you have to change it everywhere correctly.
@schotman commented on GitHub (Oct 2, 2019):
I had somewhat the same issue.
If your site is running under IIS and you have the following setting in your web config:
<system.webServer> <modules runAllManagedModulesForAllRequests="true"> .... </modules> </system.webServer>Alle 404's will be handled by .Net and thus the request will never be processed by IIS, and the default rediect rule will not fire
@ridercz commented on GitHub (Oct 13, 2019):
The redirect rule is in no way dependent on 404 error handling.