[GH-ISSUE #26] Remote Server Returned 404 Error Question #24

Closed
opened 2026-02-26 21:31:15 +03:00 by kerem · 9 comments
Owner

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>`

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>`
kerem closed this issue 2026-02-26 21:31:15 +03:00
Author
Owner

@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.

<!-- gh-comment-id:400125839 --> @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.
Author
Owner

@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 as http://scratchpaster.com/.well-known/acme-challenge/test.txt. If it is not, your routing is setup incorrectly.

<!-- gh-comment-id:400126617 --> @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 as `http://scratchpaster.com/.well-known/acme-challenge/test.txt`. If it is not, your routing is setup incorrectly.
Author
Owner

@Tessando commented on GitHub (Jun 25, 2018):

Thank you, I will test this soon. :)

<!-- gh-comment-id:400127287 --> @Tessando commented on GitHub (Jun 25, 2018): Thank you, I will test this soon. :)
Author
Owner

@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:

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_4c2c8136-f14d-4e02-91fe-e2ec2596bd49...OK
    Testing HTTP challenge:
      Preparing request to http://scratchpaste.com/.well-known/acme-challenge/probe_4c2c8136-f14d-4e02-91fe-e2ec2596bd49...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_4c2c8136-f14d-4e02-91fe-e2ec2596bd49...OK
      Getting response...Failed!
      Unable to connect to the remote server
    Deleting challenge from C:\InetPub\wwwroot\AutoAcme\probe_4c2c8136-f14d-4e02-91fe-e2ec2596bd49...OK
  Request failed: One or more errors occurred.
  Failed!
  Unable to get certificate for new host.

Thanks for your help.

<!-- gh-comment-id:400820471 --> @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: ``` 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_4c2c8136-f14d-4e02-91fe-e2ec2596bd49...OK Testing HTTP challenge: Preparing request to http://scratchpaste.com/.well-known/acme-challenge/probe_4c2c8136-f14d-4e02-91fe-e2ec2596bd49...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_4c2c8136-f14d-4e02-91fe-e2ec2596bd49...OK Getting response...Failed! Unable to connect to the remote server Deleting challenge from C:\InetPub\wwwroot\AutoAcme\probe_4c2c8136-f14d-4e02-91fe-e2ec2596bd49...OK Request failed: One or more errors occurred. Failed! Unable to get certificate for new host. ``` Thanks for your help.
Author
Owner

@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/* to http://localhost/AutoACME/* (if you are following the howto document).

<!-- gh-comment-id:400841714 --> @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/*` to `http://localhost/AutoACME/*` (if you are following the howto document).
Author
Owner

@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!

<!-- gh-comment-id:401444175 --> @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!
Author
Owner

@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 to C:\InetPub\wwwroot\AutoACME. So if you'll create C:\InetPub\wwwroot\AutoACME\test.txt, it'll be reachable as http://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/* to http://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.

<!-- gh-comment-id:413206733 --> @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 to `C:\InetPub\wwwroot\AutoACME`. So if you'll create `C:\InetPub\wwwroot\AutoACME\test.txt`, it'll be reachable as `http://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/*` to `http://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.
Author
Owner

@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

<!-- gh-comment-id:537483167 --> @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
Author
Owner

@ridercz commented on GitHub (Oct 13, 2019):

The redirect rule is in no way dependent on 404 error handling.

<!-- gh-comment-id:541445326 --> @ridercz commented on GitHub (Oct 13, 2019): The redirect rule is in no way dependent on 404 error handling.
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/AutoACME#24
No description provided.