< Back

Invoke-HttpChallengeListener

Sat Jan 18, 2020 7:32 pm

NAME Invoke-HttpChallengeListener



SYNOPSIS

Starts a local web server to answer pending http-01 ACME challenges.





SYNTAX

Invoke-HttpChallengeListener [[-MainDomain] <String>] [-ListenerTimeout <Int32>] [-Port <Int32>]

[-ListenerPrefixes <String[]>] [-WhatIf] [-Confirm] [<CommonParameters>]





DESCRIPTION

Uses System.Net.HttpListener to answer http-01 ACME challenges for the current or specified order. If MainDomain

is not specified, the current Order is used.



If running on Windows with non-admin privileges, Access Denied errors may be thrown unless a URL reservation is

added using netsh that matches the HttpListener prefix that will be used. The default wildcard prefix is

http://+/.well-known/acme-challenge and the netsh command might look something like this:



netsh http add urlacl url=http://+/.well-known/acme-challenge/ user=Everyone





PARAMETERS

-MainDomain <String>

The primary domain associated with an order.



Required? false

Position? 1

Default value

Accept pipeline input? true (ByValue, ByPropertyName)

Accept wildcard characters? false



-ListenerTimeout <Int32>

The timeout in seconds for the webserver. When reached, the http listener stops regardless of challenge status.



Required? false

Position? named

Default value 120

Accept pipeline input? false

Accept wildcard characters? false



-Port <Int32>

The TCP port on which the http listener is listening. 80 by default. This parameter is ignored when

ListenerPrefixes is specified.



Required? false

Position? named

Default value 0

Accept pipeline input? false

Accept wildcard characters? false



-ListenerPrefixes <String[]>

Overrides the default wildcard listener prefix with the specified prefixes instead. Be sure to include the

port if necessary and a trailing '/' on all included prefixes. See

https://docs.microsoft.com/en-us/dotnet ... tplistener for details.



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-WhatIf [<SwitchParameter>]



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Confirm [<SwitchParameter>]



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS

PoshACME.PAAuthorization





-------------------------- EXAMPLE 1 --------------------------



PS C:\\>Invoke-HttpChallengeListener



Start listener on default port 80 for pending challenges for the current order.









-------------------------- EXAMPLE 2 --------------------------



PS C:\\>Invoke-HttpChallengeListener -MainDomain 'test.example.com' -Port 8080 -ListenerTimeout 30



Start listener on port 8080 with a timeout of 30 seconds for the specified order.









-------------------------- EXAMPLE 3 --------------------------



PS C:\\>$prefixes =

'http://example.com/.well-known/acme-cha ... -challenge'



PS C:\\>Invoke-HttpChallengeListener -ListenerPrefixes $prefixes



Start listener using the specified prefixes for the current order.











RELATED LINKS

Project: https://github.com/rmbolger/Posh-ACME

Get-PAOrder

Get-PAAuthorizations