logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Third-party Modules View previous topic :: View next topic
Reply to topic   Topic: mod_md DNS challenge with PowerShell script
Author
FX8350



Joined: 26 May 2022
Posts: 1

PostPosted: Thu 26 May '22 13:39    Post subject: mod_md DNS challenge with PowerShell script Reply with quote

Sorry for my poor English...

Hello,

I have written a simple script using PowerShell for mod_md DNS challenge.
When I run this script manually with arguments from the powershell terminal, the TXT records are added/removed correctly via the DNS API.

Here is script
https://www.toptal.com/developers/hastebin/atisolexem.php

However, when I specify this script for MDChallengeDns01, I got errors.
Is it possible to specify a Powershell script in MDChallengeDns01?

Here is my system:
Apache 2.4.53
Windows 10 21H2
PowerShell 7.2.4

mod_md config
Code:
MDCAChallenges dns-01
MDChallengeDns01 D:\bin\PowerShell-7.2.4-win-x64\pwsh.exe -File D:\bin\Apache24\md\dns.ps1
MDCertificateAuthority https://acme-staging-v02.api.letsencrypt.org/directory
MDCertificateAgreement accepted
<MDomain example.net>
    MDMember *.example.net
</MDomain>
<VirtualHost *:443>
    ServerName example.net
    DocumentRoot "${SRVROOT}/htdocs"
    SSLEngine on
    CustomLog "|bin/rotatelogs.exe logs/access_%y-%m-%d_443.log 86400 540" combined
</VirtualHost>


Error log
Code:
[Thu May 26 11:10:40.704723 2022] [md:warn] [pid 4984:tid 636] (OS 2)指定されたファイルが見つかりません。  : example.net: dns-01 setup command failed to execute for example.net
[Thu May 26 11:10:40.704723 2022] [md:error] [pid 4984:tid 636] (OS 2)指定されたファイルが見つかりません。  : md[example.net] while[Setting up challenge 'dns-01' for domain example.net] problem[challenge-setup-failure] detail[None of the offered challenge types example.net offered for domain http-01 dns-01 tls-alpn-01 could be setup successfully. Please check the log for errors.]
[Thu May 26 11:10:40.704723 2022] [md:error] [pid 4984:tid 636] (OS 2)指定されたファイルが見つかりません。  : AH10056: processing example.net: None of the offered challenge typesexample.net offered for domain http-01 dns-01 tls-alpn-01 could be setup successfully. Please check the log for errors.

Note :指定されたファイルが見つかりません。 means The specified file could not be found.

I also tried the following batch file as run.bat
Code:
pwsh -File .\dns.ps1 %1 %2 %3

This will give different errors.
Code:
[Thu May 26 13:18:50.537822 2022] [md:error] [pid 9284:tid 608] (20014)Internal error (specific information not available): md[example.net] while[Setting up challenge 'dns-01' for domain example.net] problem[challenge-setup-failure] detail[None of the offered challenge types example.net offered for domain dns-01 could be setup successfully. Please check the log for errors.]
[Thu May 26 13:18:50.537822 2022] [md:error] [pid 9284:tid 608] (20014)Internal error (specific information not available): AH10056: processing example.net: None of the offered challenge types example.net offered for domain dns-01 could be setup successfully. Please check the log for errors.
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7371
Location: Germany, Next to Hamburg

PostPosted: Tue 07 Jun '22 12:16    Post subject: Reply with quote

From the docs for MDChallengeDns01 Directive

Quote:
Define a program to be called when the `dns-01` challenge needs to be setup/torn down. The program is given the argument `setup` or `teardown` followed by the domain name. For `setup` the challenge content is additionally given.
Back to top


Reply to topic   Topic: mod_md DNS challenge with PowerShell script View previous topic :: View next topic
Post new topic   Forum Index -> Third-party Modules